[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: namespace reference in xsl without being attribute

Subject: Re: namespace reference in xsl without being attribute in output xml
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 28 Jan 2005 14:31:39 GMT
xsl generate namespace
   I want to generate an xml file, with namespace references, like: 

   <?xml version="1.0" encoding="UTF-8"?> 
  <!DOCTYPE serial-issue PUBLIC "-//ES//DTD serials issue DTD version 5.1.0//EN//XML" "si510.dtd"> 
  <serial-issue> 
  <issue-info> 
  <ce:pii>S9999-9994(04)X0057-X</ce:pii> 
  ... 
  </issue-info> 
  ... 
  </serial-issue> 


   "Use of default namespace declaration attribute in DTD not supported.

Note the wording here: "not supported" rather than "error". this is a
deliberate non-conformance on the part of Microsoft. There is nothing
wrong with the file, however msxml is designed only to accept a subset
of legal XML documents.


  But then I get the namespace attribute in the output file: 

  ... 
  <serial-issue xmlns:ce=" http://www.elsevier.com/xml/common/dtd "> 
  ... 
  </serial-issue> 

This usage is valid according to the DTD (isn't it?) Why is this form a
problem?



If you do generate a file of the form you want (which is quite hard with
XSLT) then the resulting file will not work with microsoft parsers.
Also the namespace recommendation  itself expiltly advises against
relying on DTD defaulting as non-validating parsers might not read the
DTD. (For example the parser in mozilla/netscape never reads external
dtds so will generate namespace errors on the form that you require).

If you really want this form, the easiest way would be to pipe the output
of xslt through 
sed -e "s@xmlns:ce=.http://www.elsevier.com/xml/common/dtd.@@"


David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.