Skip to main content

Bug Tracker

Side navigation

#12520 closed bug (notabug)

Opened September 12, 2012 08:28AM UTC

Closed September 12, 2012 12:13PM UTC

CANNOT FIND ELEMENTS OF NODES IN XML

Reported by: no Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.1
Keywords: Cc:
Blocked by: Blocking:
Description

Hi, i try to find some data in my xml file.

i would like to find test:company

This is the XML:

<Datei>
  <test:company>
    <Headline>1. first headline</Headline>
    <Content>1. first text</Content>
    <Footer>1. first footer</Footer>
  </test:company>
  <test:company>
    <Headline>2. second headline</Headline>
    <Content>2. second text</Content>
    <Footer>2. second footer</Footer>
  </test:company>
</Datei>

The code:

$(xml).find('[nodeName=test:company]').each(function(){
//Do something
})

i also tested:

$(xml).find('test\\\\\\\\:company, company').each(function(){
//Do something
})

and

$(xml).find("test\\\\:company, company").each(function(){
//Do something
})

The Problem is the //Do something code is not being reached

Attachments (0)
Change History (1)

Changed September 12, 2012 12:13PM UTC by dmethvin comment:1

resolution: → notabug
status: newclosed

$(xml) does not parse XML. $.parseXML() parses XML. I don't know whether your namespace works everywhere, but fix that first.

There is no nodeName **attribute** in the markup so that should not work.

Not sure where the "test" namespace comes from.

This works for me: http://jsfiddle.net/dmethvin/FbSmh/

Please ask for help on a forum.