473,246 Members | 1,353 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,246 software developers and data experts.

Creating XML element from XPath


Is it possible to automatically create an XML element given an XPath query?
For example I have the following XML doc:

<title>Hi this is the title</title>
<description>This is a simple desc</description>

Now say I have an XPath query '/topic/age' which will return a null node if
I run it against the above XML doc. Now is there an easy way to automatically
create the age node if it doesn't exist? Or do I need to do manual parsing
and create the node manually?

For the above example probably you'll think that it should be easy to just
create the age node, but consider the other XPath such as
'/topic/description/comment' if the description node does not exist I want to
automatically create it.

So is this possible to do it with minimal work? I don't want to recreate the
wheel if .Net already has a simpler way of doing it - just couldn't find it
at the moment :)


Nov 12 '05 #1
0 1674

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

Similar topics

by: Biff Malone | last post by:
I'm creating an element at run time with the following code <xsl:variable name="myElement"> <xsl:element name="abc"> <xsl:value-of select="." /> </xsl:element> </xsl:variable> ...
by: Daniel Frey | last post by:
Hello, I'd like to extract the name of an indirectly addressed element by subsequently using the childs position: 001 <a> 002 <b1/> 003 <b2/> 004 <b3/> 005 </a>
by: Chris Kennedy | last post by:
How do create a dataset from scratch based on an XML schema. This will not be filled by a dataadapter. It will be a dataset which I add rows to and then save as an XML file. All the example depend...
by: magister | last post by:
Hello, I want to have a unique Quesiton Id key for each question under section. Not for every question in the Typed DataSet. Is there anyway I can do this...? Thanks, here is my typed...
by: Mark Broadbent | last post by:
can someone help me? After creating an xml schema file in VS 2003, I drag and drop a table onto it to create its schema. However what I am getting is a document element encapsulating the actual...
by: Mark Broadbent | last post by:
(firstly sorry Ive cross posted this in C# forum also -I forgot to include this ng) can someone help me? After creating an xml schema file in VS 2003, I drag and drop a table onto it to create...
by: mavis | last post by:
the reference of the content of XML element In XSD, how can I specify the content of an element refers to the content of another element in an xml file? Thanks a lot!
by: Yossi | last post by:
Nice tool! I am looking for something that will do the reverse. I have a whole bunch of XPath statements and I need to use them to generate and populate an XML document. I have mapping file...
by: icesign | last post by:
I know that the selector of these elements has a scope relative to the element being declared, but maybe there is a way to get beyond bounds of this scope or maybe just a way to extend base element?...
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.