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

  • Home
  • SEARCH
  • 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 6694491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:06:28+00:00 2026-05-26T06:06:28+00:00

I want to know how can I extract part of an XML document using

  • 0

I want to know how can I extract part of an XML document using jquery to an object, which will be transformed via XSLT? So, let’s say I have this sample XML document:

<nutrition>

<daily-values>
    <total-fat units="g">65</total-fat>
<saturated-fat units="g">20</saturated-fat>
<cholesterol units="mg">300</cholesterol>
<sodium units="mg">2400</sodium>
<carb units="g">300</carb>
<fiber units="g">25</fiber>
<protein units="g">50</protein>
</daily-values>

<food>
<name>Avocado Dip</name>
<mfr>Sunnydale</mfr>
<serving units="g">29</serving>
<calories total="110" fat="100"/>
<total-fat>11</total-fat>
<saturated-fat>3</saturated-fat>
<cholesterol>5</cholesterol>
<sodium>210</sodium>
<carb>2</carb>
<fiber>0</fiber>
<protein>1</protein>
<vitamins>
    <a>0</a>
    <c>0</c>
</vitamins>
<minerals>
    <ca>0</ca>
    <fe>0</fe>
</minerals>
</food>

<food>
<name>Bagels, New York Style </name>
<mfr>Thompson</mfr>
<serving units="g">104</serving>
<calories total="300" fat="35"/>
<total-fat>4</total-fat>
<saturated-fat>1</saturated-fat>
<cholesterol>0</cholesterol>
<sodium>510</sodium>
<carb>54</carb>
<fiber>3</fiber>
<protein>11</protein>
<vitamins>
    <a>0</a>
    <c>0</c>
</vitamins>
<minerals>
    <ca>8</ca>
    <fe>20</fe>
</minerals>
</food>
</nutrition>

Let’s say I just want the first < food >…< /food > block and I wish to save it as an object or a string. How can this be done using jquery? Once I have the XML block extracted, I can properly combine with a XSL document for transformation (XSLT). Thank you very much for any help!

UPDATE; CLARIFICATION:

I apologize if my question is not clear. Please allow me to clarify my position.

I am well aware that XML can be manipulated by using the browser’s DOM and the differences between IE and non-IE implementations. I can use methods like cloneNode and selectNodes on an XML Object. In fact, that’s how I have done it. Now if I bring jQuery into the equation, I’d like to replace all those lines of code with a jQuery way of dealing with it. That is, perhaps there’s a jQuery plugin that eliminates the need to directly interact with the XML DOM for each browser, taking care of cross-compatibility “behind-the-scenes”. I’m looking for a js framework that will take care of everything for me, instead of how I am dealing with it at the moment, which is separate implementations for IE and non-IE browsers.

I hope that clarifies my question.

Thank you very much for any help.

  • 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-05-26T06:06:28+00:00Added an answer on May 26, 2026 at 6:06 am

    After doing some research, it appears even those within the jQuery community recommend XML manipulation to be done by the browser, as it is usually faster.

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

Sidebar

Related Questions

I want to know I can dynamically modify an existing Crystal Report (using C#
I want to know how can I read attachment messages without using scriplets in
I'm using Tomcat 6.0, and I want to know how can I configure Tomcat's
I want to know which tool can be used to measure the cyclomatic complexity
I have binary and want to extract part of it, starting from know byte
I want to know how can we know the other users of Oracle 10g
I want to know how can I perform VS2008 load test from five different
I want to know how can i fill only certain columns while filling the
I just want to know: How can I delete 'log.txt' if the last modification
I'm learning PLT Scheme and I want to know how can I build a

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.