Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
| Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 24th, 2006, 11:40 AM
TPP TPP is offline
Authorized User
 
Join Date: Mar 2006
Location: , , .
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default cant reach data in xml with namespaces

Hi!
I have a problem retriving data from xml file.

XML:
Code:
<?xml version="1.0" encoding="utf-8" ?> 
<Data xmlns="http://something.com/Documents/Schemas/doc.xsd" 
xmlns:e="http://something.com/Documents/Schemas/file.xsd">
<e:Head>
      <e:name>John</e:name> 
      <e:address1>London, UK</e:address1> 
      <e:postNumber>123456</e:postNumber>  
</e:Head>
<body>
      <age>35</age> 
      <kids>3</kids> 
      <car>ford</car>  
</body>
</Data>
XSLT:
Code:
<?xml version="1.0" encoding="windows-1250" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:edp="http://http://something.com/Documents/Schemas/file.xsd">
        <xsl:template match="/">    
                                        <xsl:value-of select="//Data/e:Head/e:name" />
                                        <xsl:value-of select="//Data/Body/age" />
        </xsl:template>
</xsl:stylesheet>
...why do i get blank output?

Thank you for your help.
  #2 (permalink)  
Old March 24th, 2006, 11:47 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

See
http://www.dpawson.co.uk/xsl/sect2/N5536.html
especially numbers 13 and 23.

--

Joe (Microsoft MVP - XML)


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to ignore namespaces in input xml file hanifa XSLT 2 February 14th, 2007 04:14 AM
cant reach data in xml with namespaces TPP XSLT 3 March 25th, 2006 04:40 PM
Confused about XML namespaces planoie XSLT 2 June 2nd, 2005 04:23 AM
XML Namespaces billy_bob_the_3rd XML 1 January 31st, 2005 03:41 PM
.NET and XML Namespaces - NamespaceManager billy_bob_the_3rd XML 1 December 15th, 2004 08:51 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.