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

Client recognition of XML Namespace prefixes

  • From: Will Bradley <willbr@m...>
  • To: xml-dev@l...
  • Date: Tue, 05 Dec 2000 16:16:14 -0800

client recognition
I have a question about dealing with namespaces.  

Let's take a look at an example, and then I'll pose my question.

<root>
  <tree xmlns:dog="http://dogs.com/some/schema"
        xmlns:people="http://people.com/some/schema">
    <dog:name>Fido</dog:name>
    <dog:age>2</dog:age>
    <people:name>Will</people:name>    
    <people:age>Old</people:age>
  </tree>
</root>

When a client application recieves this xml block, and wants to interpret
it, can it, and should it, make assumptions about the namespace prefix?
Further, when calling the DOM's function selectSingleNode(), or more
specifically, when using XSL Patterns, or XPath expressions, how can one
determine the validity of a query for a specific tag?  

How do you find the tag you want within a hierarchy, without knowing what
prefix its namespace happens to be using.  It seems that there is no way to
be absolutely sure that if I search for "/root//dog:name", another app would
not have gone and switched the namespace prefix to "Dog", in which case my
search would fail due to case sensitivity, but the XML Validator would NOT
fail, because the grammar is still valid.

I realize that you can search for "/root//*:name", but that defeats the
purpose of validation, this search might return the node
"/root/tree/people:name".

Thanks in advance!

Will Bradley

p.s.  I realize I might be asking for something that is simply not possible.
The reason it might not be possible is that I (the client app), regardless
of namespace prefix, have to be certain that the Schema used to validate the
XML was in fact the correct Schema.  This would be (although not
impossible,) ... hard.

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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.