Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7747487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:32:31+00:00 2026-06-01T10:32:31+00:00

My existing xml file looks like <transaction> <id> <in>computer</in> <sn>1234567</sn> <book>JAVA</book> <author>klen</author> </id> <data>

  • 0

My existing xml file looks like

<transaction>
  <id>
    <in>computer</in>
    <sn>1234567</sn>
    <book>JAVA</book>
    <author>klen</author>
  </id>
  <data>
    <dateTime>2011-06-24T17:08:36.3727674+05:30</dateTime>
    <key>Err</key>
  </data>
</transaction>

but I want to add node before <id> node.Now I have 2 question
1.Using dom perser how to add node before ?
2.Is it possible to do this other than dom parser?because I give a demo xml original xml is large so I need a good parser for better performance.

I want to add this

       <xs:schema id="transaction" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">  
    <xs:element name="transaction" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">  
      <xs:complexType>  
        <xs:choice minOccurs="0" maxOccurs="unbounded">  
          <xs:element name="id">  
            <xs:complexType>  
              <xs:sequence>  
                <xs:element name="in" type="xs:string" minOccurs="0" />  
                <xs:element name="sn" type="xs:string" minOccurs="0" />  
                <xs:element name="book" type="xs:string" minOccurs="0" />  
                <xs:element name="author" type="xs:string" minOccurs="0" />  
               </xs:sequence>  
            </xs:complexType>  
          </xs:element>  
          <xs:element name="data">  
            <xs:complexType>  
              <xs:sequence>  
                <xs:element name="dateTime" type="xs:dateTime" minOccurs="0" />  
                <xs:element name="key" type="xs:string" minOccurs="0" />  
              </xs:sequence>  
            </xs:complexType>  
          </xs:element>  
          <xs:element name="productData">  
            <xs:complexType>  
              <xs:sequence>  
                <xs:element name="dateTime" type="xs:dateTime" minOccurs="0" />  
                <xs:element name="key" type="xs:string" minOccurs="0" />  
              </xs:sequence>  
            </xs:complexType>  
          </xs:element>  
        </xs:choice>  
      </xs:complexType>  
    </xs:element>  
  </xs:schema> 

before <id> node under <transaction> node.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T10:32:32+00:00Added an answer on June 1, 2026 at 10:32 am

    Question 1: “Using dom perser how to add node before ?”

    Answer 1:
    I assume that you are using org.w3c.dom. Let node1 be a Node in your document. Let node2 be another Node in your document. You want to insert node1 before node2.

    Question 2: “Is it possible to do this other than dom parser?”

    Answer 2: DOM is not the current state of the art with respect to XML. You should look into XSLT, SAX, and or JAXB.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an existing XML file that I would like to append without changing
I would like to edit an existing XML file while preserving it's original layout.
I have XML file which looks like this: <?xml version=1.0?> <results> <row id=100><name>name blah</name></row>
Purpose: I plan to Create a XML file with XmlTextWriter and Modify/Update some Existing
I have several existing XML schema files with a defined data model. I would
I have an option to choose between local based data storing (xml file) or
I have an existing data model. I would like to express this data model
I'm trying to read existing xml file, that has duplicated namespace declarations. It is
I have a giant XML file in which I would like to update a
I'm opening an existing XML file with C#, and I replace some nodes in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.