473,395 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

how to reference data when a node has a XMLNS pointing to a DTD?


OK, I'm not sure what I'm missing here.

I'm working with this XML:

<?xml version="1.0" encoding="utf-8"?>
<GroupDataBlock xmlns="http://www.acme.com/data.dtd">
<GroupInfo>
<ProgramID>3002616</ProgramID>
</GroupInfo>
</GroupDataBlock>

and this XSL:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:value-of select="GroupDataBlock/GroupInfo/ProgramID" /><br />
</xsl:template>
</xsl:stylesheet>

Any idea why it won't show the ProgramID value?

Is there something in the DTD that I need to know to display this
correctly? Isn't the GroupInfo nested within the GroupDataBlock node?

Any help would be much appreciated.

Thanks,
Andy

Jul 20 '05 #1
1 1077


Namespace declarations in xmlns don't really "point to" anything, the
URI is just a string identifying the namespace, it is never "looked up"

This is a FAQ. (see the faq for xsl-list for example)

"Andy" <si****@imagekiller.com> writes:
OK, I'm not sure what I'm missing here.

I'm working with this XML:

<?xml version="1.0" encoding="utf-8"?>
<GroupDataBlock xmlns="http://www.acme.com/data.dtd">
so that is the element with name consisting of local name
GroupDataBlock
and namespace
http://www.acme.com/data.dtd
(it's unusual to use a dtd uri as a namespace, but anything would do,
xmlns="data:,hello"
for example.) The Processor will not look at the dtd file anyway.

<xsl:value-of select="GroupDataBlock/GroupInfo/ProgramID" />


that selects an element GroupDataBlock in no-namespace (and similarly
GroupInfo and ProgramID

add xmlns:x="http://www.acme.com/data.dtd" to your xsl:stylesheet
element so x: is in scope for the whole stylesheet then you can use

<xsl:value-of select="x:GroupDataBlock/x:GroupInfo/x:ProgramID" />

to select elements from this namespace.

David
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: K riley | last post by:
Hi. I need some help. I have an xml file what will contain hundreds of groups and will have an associated xsd. My overall goal is to have a web application that allows a user to input a...
0
by: Frederico Guimar??es via DotNetMonster.com | last post by:
Hi, I'm trying to use the Microsoft.Web.Services2.Messaging. ISoapFormatter but I receive this error: System.Xml.XmlException: Reference to undeclared parameter entity, 'meetingmaker'. at...
4
by: Brian | last post by:
I am trying to use a web service from a non Microsoft product. When I do a "Add Web Reference" from the Visual Studio dialog box, a request is generated and received by the web services supplier....
5
by: Jeff | last post by:
We are using .Net and the wsdl Utility to generate proxies to consume web services built using the BEA toolset. The data architects on the BEA side create XML schemas with various entities in...
0
by: XML newbie: Urgent pls help! | last post by:
When, I try to run my pgm, I get the message: Object Reference not set to an instance of object. I get this for line in the ParseLoginResponse function below: node =...
0
by: XML newbie: Urgent pls help! | last post by:
I am using VB.Net. My program is to connect to a remote IPAddress. Once, it verifies the login information it should display the SessionID and enable some button . I appreciate your help and thanku...
0
by: Richard Gregory | last post by:
Hi, I have the wsdl below, for an Axis web service, and when I select Add Web Refernce in Visual Studio the proxy is missing a class representing the returnedElementsType (see reference.cs below...
11
by: Tony Girgenti | last post by:
Hello. I have attached the XML data in question at the end of this post. I don't understand what is between <TripDataand </TripData>. When i talked to the publisher of the XML document, he...
0
by: theonlydavewilliams | last post by:
Hi there I'm hoping there's an easy answer to a (hopefully) not too long-winded issue... I'm building a C# web client using a proxy wsdl.exe'd from a wsdl file and six schemas, each in a different...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.