.NETGURU
NameSpace Confusion
Messages   Related Types
This message was discovered on microsoft.public.dotnet.xml.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...

Dot Net Guru
I have attached an XML document that uses the following definition in the
root element xmlns="http://www.rosettanet.org/RNIF/V02.00";. When I load
the attached XML into an XmlDocument object then try to perform XPath
queries I get nothing back. I know it has to do with the namespace but I
have not run across one like this before and I am not very good with
namespaces. I take and create a namespace object and just assigned "me" as
the identifier and then I was able to get the root back with the XPath
"/me:ServiceHeader". But then I went to the next level and got nothing
back. Do I have to use"me:" on all levels because of the way it is defined
or is their an easier way.

Thanks,

Dot Net Guru

Reply to this message...
 
    
Dare Obasanjo [MSFT] (VIP)
"Dot Net Guru" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Yes, because all the elements in the document are in that namespace.

--
This posting is provided "AS IS" with no warranties, and confers no rights.

Reply to this message...
 
    
Dot Net Guru
Dare,

Thanks I understand how the NamespaceManager comes into play when working
directly with the XmlDocument.

Now when I run my stylesheet against the XmlDocument using XslTransform none
of my selects work. How do I handle this situation in the stylesheet since
I can't add a NamespaceManager to the Transform method?

Thanks,

Dot Net Guru
"Dare Obasanjo [MSFT]" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Krish (VIP)
Dot Net Guru, Namespace on the root element should not cause any issues with XSLT
transform.
Krish

"Dot Net Guru" wrote:

[Original message clipped]

Reply to this message...
 
    
Oleg Tkachenko [MVP] (VIP)
Dot Net Guru wrote:

[Original message clipped]

XSLT dosn't need any NamespaceManagers. XSLT stylesheet is XML document
so it handles namespaces natively - just declare the same namespace in
xsl:stylesheet element and use that prefix in your selections.

--
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com
Reply to this message...
 
    
Dot Net Guru
Thanks Oleg.

Dot Net Guru

"Oleg Tkachenko [MVP]" <oleg@NO!SPAM!PLEASEtkachenko.com> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
 
System.Xml.XmlDocument
System.Xml.Xsl.XslTransform




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification