[XML-DEV Mailing List Archive Home]
[Reply To This Message]
RE: XML Schema Validation Problem
- To: 'Jeni Tennison' <jeni@j...>
- Subject: RE: XML Schema Validation Problem
- From: Jason Brown <Jason@i...>
- Date: Thu, 9 Jan 2003 11:26:10 -0000
- Cc: "XML-DEV (E-mail)" <xml-dev@l...>
Title: RE: XML Schema Validation Problem
Thank you very much, That is now working fine. I had the XPath property set but didn't know about the namespaces property.
From: Jeni Tennison [mailto:jeni@j...]
Sent: 09 January 2003 11:06
To: Jason Brown
Cc: XML-DEV (E-mail)
Subject: Re: XML Schema Validation Problem
> I have a Schema that has 2 namespaces. This is referenced by an XML
> document. I can successfully parse the XML against the schema,
> however I cannot then assign any data to an Object using the
> SelectSingleNode method of a FreeThreadedDOMDocument40. According to
> the object browser this should return an IXMLDOMNode, the result I
> get is the object is still nothing.
You don't show the code that you're using, but my guess would be that
when you use selectSingleNode(), you're not including a namespace
prefix on the element name. Try using the following code:
// Use XPath rather than XSL Patterns to select your nodes
// Declare the namespace you want to use with a prefix
// Use the prefix when you refer to the element you want to select
node = yourDOM.selectSingleNode("/xyz:Environment");
When you use XPath, if you specify an element name without a prefix as
in "/Environment" then you will only select elements with that local
name in *no namespace*. If you want to select elements that are in a
namespace (as your <Environment> element is) then you need to declare
that namespace with a prefix and use that prefix to refer to the
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format
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