[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";
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">
          <SE xsi:type="SE-VOD-Type">
                    <serviceProviderID>ACME inc</serviceProviderID>
         <UE xsi:type="UE-VOD-Type">
     <movieName>Rocky CIX</movieName>

========= test.xsl ========
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
  <xsl:output method="text"/>
  <xsl:preserve-space elements="text"/>
    <xsl:template match="/IPDRDoc">
     <xsl:text>a, b, </xsl:text>d, e

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

                ACME inc

Rocky CIX

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,


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