[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Problem involving xmlns namespace declaration in sourc

Subject: Problem involving xmlns namespace declaration in source xml
From: "Pankaj Bishnoi" <pankaj.bishnoi@xxxxxxxxxxx>
Date: Wed, 26 Apr 2006 11:32:12 +0530
hege refsnes
Hi All
          I am using Xalan for doing a simple transformation. My Source Xml
is::

<?xml version="1.0"?>
<persons
xmlns="http://www.w3schools.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3schools.com note.xsd">

<person>
  <full_name>Hege Refsnes</full_name>
  <child_name>Cecilie</child_name>
</person>
<person>
  <full_name>Tove Refsnes</full_name>
    <child_name>Hege</child_name>
    <child_name>Stale</child_name>
    <child_name>Jim</child_name>
    <child_name>Borge</child_name>
</person>
<person>
  <full_name>Stale Refsnes</full_name>
</person>
</persons>



and the xsl is ::::



<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.1" xmlns:java="http://xml.apache.org/xslt/java"
xmlns="http://www.w3schools.com" xmlns:str="http://exslt.org/strings"
xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect"
extension-element-prefixes="redirect">
     <xsl:output method="xml" version="1.0" encoding="ISO-8859-1"
indent="yes"/>
      <xsl:variable name="apos">'</xsl:variable>
     <xsl:template match="/">
          <persons>
               <xsl:apply-templates select="/persons/person"
mode="_persons_person_order1"></xsl:apply-templates>
          </persons>
     </xsl:template>
     <xsl:template match="/persons/person" mode="_persons_person_order1">
          <person>
               <full_name>
                    <xsl:value-of select="full_name"/>
               </full_name>
               <child_name>
                    <xsl:value-of select="child_name"/>
               </child_name>
          </person>
     </xsl:template>
</xsl:stylesheet>


When i transform then i do not get map values in corresponding target
elements. The reason for that is in the source file for the root element
persons i am having a namespace declaration as:::
xmlns="http://www.w3schools.com" when i remove this namespace declaration
then the transfornation works fine. What is the problem that only this
namespace tag does not work.


Thanks for help in advance

Thanks
Pankaj

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.