473,471 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Creating XML element from XPath

Hi,

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

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

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 :)

Thanks,

Victor
Nov 12 '05 #1
0 1680

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

Similar topics

1
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> ...
2
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>
1
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...
0
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...
0
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...
0
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...
5
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!
1
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...
0
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?...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
1
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.