[xslt] XSLT and doctype



I'm new to XSL and I think it's my misunderstanding but I'm having a
problem running XSLT on an XML file with a DOCTYPE.

It's best demonstrated by xsltproc but I get the same results no matter
which engine I'm using.

XML file is

<glade-interface>
  <widget class="GtkWindow" id="window1">
    <property name="visible">True</property>
    <property name="title" translatable="yes">window1</property>
    <property name="type">GTK_WINDOW_TOPLEVEL</property>
    <property name="window_position">GTK_WIN_POS_NONE</property>
    <property name="modal">False</property>
    <property name="default_width">500</property>
    <property name="default_height">400</property>
    <property name="resizable">True</property>
    <property name="destroy_with_parent">False</property>
  </widget>
</glade-interface>


XSL file

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
          xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
  <xsl:output method="text" />
                                                                                                                      
 <xsl:template match="glade-interface">
    In the main Glade bit
 </xsl:template>
                                                                                                                      
</xsl:stylesheet>


if I run xsltproc with the 2 files I get

        True
        window1
        GTK_WINDOW_TOPLEVEL
        GTK_WIN_POS_NONE
        False
        500
        400
        True
        False
   

If I run xsltproc --novalid with the 2 files I get 

 
       In the main Glade bit

It also works if I take the DOCTYPE out of the XML file

I can validate the XML file using xmllint. 

Any help would be extremely appreciated
Peter



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]