473,802 Members | 2,026 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting schema data types from XPathDocument/XPathNavigator

Is there an easy way to get the schema's data type for a XPathNavigator value?

I need to be able to determine the data type for the xml value based off of
an unknown schema and unknown xml file that is handed off to my code. I've
been able to figure out how to get the data type by reading through a
validating reader, but I can't seem to find an easy way to get this when
using XPath expressions.

The process I have is as follows:
1. Create a validating reader for the unknown xml file given to me.
2. Create a schema from the unknown schema file given to me.
3. Add the schema to the validating reader.
4. Create an XPathDocument using the validating reader.
5. Create an XPathNavigator from the XPathDocument.
5. Create XPathExpression s based off of the xpath information given to me.
6. Perform selects() on the expressions to get to the XPathNavigator with
the values I'm looking for. This is where I need to match the value to the
schema data type but I have had no luck figuring out a way to do it.
Nov 12 '05 #1
1 1746
Phil wrote:
Is there an easy way to get the schema's data type for a XPathNavigator value?


I don't think so. XPath 1.0 is schema-unaware language (because it was
published 2 years before XML Schema) and so is XPathNavigator API.
--
Oleg Tkachenko [XML MVP, MCP]
http://blog.tkachenko.com
Nov 12 '05 #2

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

Similar topics

8
4581
by: Garyrek | last post by:
Hi I have an url where I have xml data POSTED and I need to parse the URL to read the data - Meanwhile here is my xml data =================================== <?xml version="1.0" encoding="utf-16"?> <?adf version="1.0"?> <!DOCTYPE adf SYSTEM "http://whoscalling.com/dtd/adfdtd.dtd"> <adf> <prospect status="new">
1
4394
by: Ian Lawton | last post by:
Hi, in a C# app, I have an XPathDocument that looks similar to this: <row uniqueid="4234" /> <row uniqueid="4365" /> <row uniqueid="3124" /> <row uniqueid="9879" /> <row uniqueid="1332" /> <row uniqueid="4322" />
1
8221
by: LuAnn Bradford | last post by:
I have read the messages about adding namespaces, but have not found how to do so when using an XPathDocument instead of an XmlDocument. I have an application that writes a dataset using WriteXML. The file contains a default namespace. A second application reads the file using the XPathDocument Load method. My Select expression will not work with the default namespace. I am very new to this and would appreciate any help! LuAnn
2
11936
by: Robert Strickland | last post by:
I load an xml stream into a xpathdocument type, compile a xpath expression and select to specific node. I find the node and wish to return the innerxml of that node. When I use value of the current node I get back the "values" of the child nodes but no formatted xml which I need for transformations later in the sequence. Is there a way to pull pure xml from the xpathdocument?
2
3470
by: steve bull | last post by:
I have an XPathDocument which contains a list of color definitions. If I want to add a new color definition to, or delete an existing one from, the source xml file how can I force this to be reflected in the XPathDocument? Do I have to reload the XPathDocument? If so, would I need to dispose of the old XPathDocument and it's associated XPathNavigator somehow? Can I even change a node value in the XPathDocument? E.g. if I want to change...
6
15513
by: Chua Wen Ching | last post by:
Hi there, I had this xml file with me (not yet consider implementing xml namespaces yet). <?xml version='1.0'?> <Object> <Windows> <EID>1</EID> <EDesc>Error 1</EDesc> </Windows>
5
9570
by: Paw Pedersen | last post by:
When you are "working" on a specific node from a XmlDocument instance, is it possible to get the full xpath to this node? Regards Paw
2
7445
by: Christian Rühl | last post by:
heyho, guys! here's another question for you now: i built an iterator to get all the nodes with a certain attribute in an xml dom. it all looks like this (i'm using .NET framework 1.1) string xpath;
1
2823
by: WestyCHC | last post by:
Morning all from a newbie. I have recently written an automation program (my first ever program) for testing and now I am trying to read XML data and assign the values to variables (rather than Excel). Using XPathNavigator I managed to read some of the data, but in order to do this I had to manually remove the attributes from the Parent Nodes. Going forward this isnt an option as we may be reading and running hundreds of files a day and so I...
0
10538
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10305
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10285
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7598
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6838
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5494
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4270
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2966
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.