Subject: [xsl] Using XSLT on a Schema From: Simon Cansick <SC@xxxxxxxxxxxxxxxxxxx> Date: Tue, 18 Jun 2002 11:43:47 +0100 |
I cannot seem to get an XSLT working on an XML Schema. When debugging the transaformation, it never seems to find the Schema or ElementType nodes, is this due to the namespace declarations in the XSLT file? Can anyone tell me how I can transform this schema? I have prepared a simple example of the problem I get. XML Schema - <?xml version="1.0"?> <Schema name="xmlSchemaSalesOrder" xmlns="urn:schemas-microsoft-com:xml-data" xmlns:dt="urn:schemas-microsoft-com:datatypes"> <ElementType model="open" name="SALESORDER" content="eltOnly" order="seq"> <description>some description</description> <element maxOccurs="1" minOccurs="1" type="ACCOUNTCODE"/> </ElementType> <ElementType name="ACCOUNTCODE" content="textOnly" dt:type="string"> <description>some more description</description> </ElementType> </Schema> XSLT - <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <xsl:apply-templates select="/Schema"/> </html> </xsl:template> <xsl:template match="Schema"> <TABLE border="0" cellspacing="1" width="95%"> <tr><td><xsl:value-of select="@name"/></td></tr> <xsl:apply-templates select="ElementType"/> </TABLE> </xsl:template> <xsl:template match="ElementType"> <tr> <td><xsl:value-of select="description"/></td> </tr> </xsl:template> </xsl:stylesheet> The result I get is - <html></html> I am using MSXML3. Thanks for any help, Simon Cansick Access Accounting Ltd --------------------------------------------------------------- The Old School, Stratford St Mary, Colchester, Essex. CO7 6LZ, United Kingdom. Phone +44 (0) 1206 322575 Fax +44 (0) 1206 322956 Internet http://www.access-accounts.com http://www.accessweb.co.uk --------------------------------------------------------------- Access Accounts - The Brand Leader in e-commerce financials This message, including any associated files, is confidential; its contents do not constitute a commitment by Access Accounting Ltd except where provided for in a written agreement between you and Access Accounting Ltd. Any opinions expressed within this email are those of the author and are not necessarily endorsed by Access Accounting Ltd. Any unauthorised disclosure, use or dissemination, either whole or partial, is prohibited. If you are not the intended recipient of the message, please notify the sender immediately. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Format text within a XML , David Carlisle | Thread | Re: [xsl] Using XSLT on a Schema, David Carlisle |
Re: [xsl] simple xsl:choose questio, Meir | Date | RE: [xsl] Writing a stylesheet to c, Andrew Welch |
Month |