xsl-list
[Top] [All Lists]

Re: namespace reference in xsl without being attribute in output xml

2005-01-28 07:31:39

   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(_at_)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
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>