[xsl] template pattern does not get matched properly with xmlns declaration

Subject: [xsl] template pattern does not get matched properly with xmlns declaration
From: Helen_Li@xxxxxxx
Date: Thu, 18 Jan 2001 10:24:38 -0500


Hi Guys,

I am currently doing some work on XSL, mainly transforming XML file to text
format.  I have written a small xsl file and encounted the following problem.

==== xml file test.xml ====
<?xml version="1.0"?>
<IPDRDoc xmlns="http://www.ipdr.org/namespaces/ipdr";
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance";
xsi:schemaLocation="http://www.ipdr.org/namespaces/ipdr/VideoOnDemand1.xsd";
seqNum="124" version="2.0" >
   <IPDRRec info="Vendor name, Inc.">
      <IPDR seqNum="1" time="2000-02-01T07:00:00Z">
           <SS id="ses10" service="RTSP">
          <SC xsi:type="SC-VOD-Type">
               <subscriberId>199.203.132.2</subscriberId>
          <destAddress>192.168.1.10</destAddress>
          </SC>
          <SE xsi:type="SE-VOD-Type">
                    <serviceProviderID>ACME inc</serviceProviderID>
          <sourceAddress>38.249.211.7</sourceAddress>
          </SE>
         </SS>
         <UE xsi:type="UE-VOD-Type">
     <movieName>Rocky CIX</movieName>
     <movieID>10234</movieID>
          <startTime>1999-12-31T23:59:00</startTime>
                <endTime>2000-01-01T04:15:00</endTime>
     <terminationStatus>normal</terminationStatus>
         </UE>
    </IPDR>
  </IPDRRec>
</IPDRDoc>

========= test.xsl ========
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
  <xsl:output method="text"/>
  <xsl:preserve-space elements="text"/>
    <xsl:template match="/IPDRDoc">
     <xsl:text>a, b, </xsl:text>d, e
    </xsl:template>
</xsl:stylesheet>

After running "java com.jclark.xsl.sax.Driver test.xml test.xsl test.out", the
output is not what I want.
======== output file test.out==========






199.203.132.2
192.168.1.10


                ACME inc
38.249.211.7



Rocky CIX
10234
        1999-12-31T23:59:00
                2000-01-01T04:15:00
normal




it seems the xsl template on pattern "/IPDRDoc"  can not get matched properly.

However after I removed xmlns declaration(i.e xmlns="
http://www.ipdr.org/namespaces/ipdr"; part) from IPDRDoc element
in test.xml, everything is just working fine. I have no idea what's wrong with
the xml/xsl test files.

I am wondering if any of you know about it?

Thanks a lot,

Helen


********************
The information contained in this e-mail is confidential and intended
solely for the use of the addressee(s) listed above.  If you have obtained
this message in error or otherwise, please notify the sender and destroy
all copies of this message immediately.



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread