xsl-list
[Top] [All Lists]

[xsl] convert xml with schema to html with xslt

2009-12-21 05:21:31
Hello!

I have a problem. I have a small xml file which has a schema declaration in the 
root element. I cannot convert it to html with an xslt file. If i remove the 
schema declaration the conversion is fine.
Please suggest me how to correct this. 
I have included a shcema import but it didnt help:
<xsl:import-schema namespace="urn:Verlag" schema-location="urn:Verlag 
http://192.168.190.181:8879/xml/STRUKTUR.xsd"; />

The xml file looks like this:
<LOSCHNIGG xmlns="urn:Verlag" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="urn:Verlag http://192.168.190.181:8879/xml/STRUKTUR.xsd";>
        <metadaten>
                <gilt-ab>1000-01-01</gilt-ab>
                <gilt-bis>9999-12-31</gilt-bis>
                <Fassung_Publikation>
                        <Publikationsstand>2009-12-19</Publikationsstand>
                        <Release_Version>1</Release_Version>
                </Fassung_Publikation>
        </metadaten>
        <para>
text...
        </para>
</LOSCHNIGG>

The xml works fine and the xsd is in the right place.

The xsl looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
xmlns="http://www.w3.org/1999/xhtml"; version="2.0">
    
<!--    <xsl:import-schema namespace="urn:Verlag" schema-location="urn:Verlag 
http://192.168.190.181:8879/xml/STRUKTUR.xsd"; />-->

        <xsl:output encoding="UTF-8" indent="yes" method="html" version="1.0" />
                
        <xsl:template match="@*|node()">
           <xsl:copy>
              <xsl:apply-templates select="@*|node()"/>
           </xsl:copy>
        </xsl:template>
        
                <xsl:template name="paragraph" match="para">
                        <xsl:element name="p">
                                <xsl:apply-templates/>
                        </xsl:element>
                </xsl:template>

        <xsl:template match="/">
                <xsl:element name="html">
                        <xsl:element name="head">
                                <xsl:element name="title">Preview</xsl:element>
                        </xsl:element>
                        <xsl:apply-templates/>
                </xsl:element>
        </xsl:template>
</xsl:stylesheet>

Thank you!
Lajos


      

--~------------------------------------------------------------------
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>