Create Element from XML String - XML SOAP
This is a discussion on Create Element from XML String - XML SOAP ; Hi,
I have a string like "<DATA attr1=100><Item id=1 value=hello /></
DATA>" and I have an XML document such as the following:
<Document>
<Content>
<!-- I need to insert the DATA tag here -->
</Content>
</Document>
The document is already ...
-
Create Element from XML String
Hi,
I have a string like "<DATA attr1=100><Item id=1 value=hello /></
DATA>" and I have an XML document such as the following:
<Document>
<Content>
<!-- I need to insert the DATA tag here -->
</Content>
</Document>
The document is already loaded into an XMLDOMDocument object. I would
like to insert the XML in the string within the <Content> element. How
do I do it using MSXML? Is there a way to create an element directly
from its XML definition?
-
Re: Create Element from XML String
T wrote:
> I have a string like "<DATA attr1=100><Item id=1 value=hello /></
> DATA>"
Attribute values need to be quoted so that snippet is not well-formed
and therefore can't be parsed successfully as XML.
> and I have an XML document such as the following:
> <Document>
> <Content>
> <!-- I need to insert the DATA tag here -->
> </Content>
> </Document>
>
> The document is already loaded into an XMLDOMDocument object. I would
> like to insert the XML in the string within the <Content> element. How
> do I do it using MSXML? Is there a way to create an element directly
> from its XML definition?
You need to use a second document and call loadXML on it, then you can
move or import (MSXML 5/6) the nodes to the original document.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Similar Threads
-
By Application Development in forum CSharp
Replies: 2
Last Post: 11-30-2007, 02:50 PM
-
By Application Development in forum labview
Replies: 0
Last Post: 10-24-2007, 11:40 AM
-
By Application Development in forum RUBY
Replies: 3
Last Post: 09-12-2007, 02:21 PM
-
By Application Development in forum Python
Replies: 0
Last Post: 06-25-2007, 03:21 PM
-
By Application Development in forum XML SOAP
Replies: 4
Last Post: 04-21-2006, 12:55 PM