Re: namespace reference in xsl without being attribute
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 ________________________________________________________________________
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format