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 8077163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:25:06+00:00 2026-06-05T15:25:06+00:00

I have the following XML Document: <?xml version=\1.0\ encoding=\UTF-8\?> <atom:entry xmlns:atom=\http://www.w3.org/2005/Atom\ xmlns:apps=\http://schemas.google.com/apps/2006\ xmlns:gd=\http://schemas.google.com/g/2005\> <apps:property

  • 0

I have the following XML Document:

<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<atom:entry xmlns:atom=\"http://www.w3.org/2005/Atom\" xmlns:apps=\"http://schemas.google.com/apps/2006\" xmlns:gd=\"http://schemas.google.com/g/2005\">
  <apps:property name=\"memberId\" value=\"Tom\"/>
</atom:entry>

All I’m trying to do is get the apps:property node. However everything I try in LibXML returns nothing.

From reading the LibXML documentation here for LibXML::XML::XPath. I would assume that I don’t need to specify the two namespaces since they are defined on the root node.

Here is what I’ve tried:

@document.find('/apps:property')
@document.find('//apps:property')
@document.find('/atom:entry/apps:property')
@document.find('//atom:entry/apps:property')
@document.find('/property')
@document.find('/atom:entry')
@document.find('//property')
@document.find('/entry')

None of the above return a result with the specified document. I’ve tried them all with different combinations of the atom and apps namespace definitions as well but it doesn’t seem to have an effect.

If anyone could show me what very simple thing I must be missing it would be much appreciated.


It turns out that the problem stems from the document being created dynamically rather than being read from a file.

When I write the document to a file and read it in I can search it. When I create the document, create the root element and add the child programmatically I get nil every time I try to search, oddly enough each works just fine. Do I have to “finalize” or do some other stupid thing to the document somehow before I can search it?

  • 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-05T15:25:07+00:00Added an answer on June 5, 2026 at 3:25 pm

    If I explicitly parse the document then I can search it.

    Looks like that might be the solution unless it’s possible for the parse tree to be generated as the document is built.

    Time to look at the code I suppose.

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

Sidebar

Related Questions

I have the following XML document <?xml version='1.0' encoding='UTF-8'?><entry xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005' xmlns:issues='http://schemas.google.com/projecthosting/issues/2009' gd:etag='W/DEAERH47eCl7ImA9WhZTFEQ.'><id>http://code.google.com/feeds/issues/p/chromium/issues/full/921</id><published>2008-09-03T22:51:22.000Z</published><updated>2011-03-19T01:05:05.000Z</updated><title>Incorrect rendering</title><content
I have XML shaped like the following: <?xml version=1.0 encoding=UTF-8?> <feed xmlns=http://www.w3.org/2005/Atom xmlns:openSearch=http://a9.com/-/spec/opensearch/1.1/ xmlns:docs=http://schemas.google.com/docs/2007
Lets say I have the following XML file: <?xml version=1.0 encoding=utf-8?> <Customers xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:noNamespaceSchemaLocation=Customer.xsd>
I have the following XML: <?xml version=1.0 encoding=UTF-8?> <gnm:Workbook xmlns:gnm=http://www.gnumeric.org/v10.dtd xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://www.gnumeric.org/v9.xsd> <office:document-meta xmlns:office=urn:oasis:names:tc:opendocument:xmlns:office:1.0
I have following XML file: <?xml version=1.0 encoding=UTF-8?> <beans xmlns=http://www.springframework.org/schema/beans xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:jaxrs=http://cxf.apache.org/jaxrs xmlns:context=http://www.springframework.org/schema/context xmlns:cxf=http://cxf.apache.org/core
Given the following XML file: <?xml version=1.0 encoding=UTF-8?> <process name=TestSVG2 xmlns=http://www.example.org targetNamespace=http://www.example.org xmlns:xsd=http://www.w3.org/2001/XMLSchema> <sequence>
I have the following XML document: <tt xmlns=http://www.w3.org/ns/ttml xmlns:tts=http://www.w3.org/ns/ttml#styling xml:lang=en> <head></head> <body> <div xml:lang=it>
I have an xml document like this: <?xml version=1.0 encoding=UTF-8?> <foo:root xmlns:foo=http://abc.com# xmlns:bar=http://def.com xmlns:ex=http://ex.com>
I have the following XML: <?xml version=1.0 encoding=UTF-8 standalone=yes?> <application xmlns=http://research.sun.com/wadl/2006/10> <doc xmlns:jersey=http://jersey.dev.java.net/ jersey:generatedBy=Jersey:
This is my XML Document. <?xml version=1.0 encoding=UTF-8 standalone=yes?> <w:document xmlns:w=http://schemas.openxmlformats.org/wordprocessingml/2006/main> <w:body> <w:p> <!--

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.