OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: [xml-dev] Error in XSL transformation: Schema --> XML

[ Lists Home | Date Index | Thread Index ]

It's generally a good idea in a stylesheet to set the default namespace (xmlns="xxxx") to the namespace used most often in the result document, not to the namespace used in the source document. This is because the stylesheet default namespace is used when generating result elements, but it's not used when matching source elements. In XPath expressions and patterns that refer to namespaced elements in the source document, an explicit namespace prefix must always be used, regardless of the default namespace that's set in the stylesheet.
 
Mike Kay
-----Original Message-----
From: Oscar Pérez [mailto:javalotodo@iespana.es]
Sent: 16 January 2002 10:33
To: xml-dev@lists.xml.org
Subject: [xml-dev] Error in XSL transformation: Schema --> XML

Hello,
 
I'm experiencing a problem in doing XSL transformations from a XMLSchema document to another XML.
I'm using XMLSpy with the Xalan XSLT processor.
The thing is that with the next header in the XMLSchema:
 
<schema
    xmlns="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.themindelectric.com/package/es.promofinarsa.eodin.core.convocatoria/">
 
and the following header for the XSL document:
 
<xsl:stylesheet xmlns="http://www.w3.org/2001/XMLSchema"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:fo="http://www.w3.org/1999/XSL/Format"
    xmlns:xalan="http://xml.apache.org/xslt"
    version="1.0">
the WHOLE XML resultant document would look wrong like this:
 
<?xml version="1.0" encoding="UTF-8"?>
<scr xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"/>
 
The transformation works PERFECTLY when I take out
    xmlns="http://www.w3.org/2001/XMLSchema"
from the schema header.
But I don't think is a good thing to take the schema namespaces out from its header, ISN'T IT?
 
 
Any help would be appreciated.
 
Kind regards,
 
Oscar.




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS