in reply to LibXML Namespace issue

In XML, every namespace must be defined in order to be used. If your XML data do not contain the definitions of the namesepaces, they are not well-formed XML and cannot be parsed by libxml (nor XML::LibXML).

Are you sure your XML documents do not contain something like the following?

xmlns:dc="http://purl.org/dc/elements/1.1"
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: LibXML Namespace issue
by ohm.kazhbu (Initiate) on Jan 03, 2014 at 12:14 UTC

    The XML does have the namespace defined. "xmlns:dc="http://purl.org/dc/elements/1.1/" The problem I am having is I need to grab a chunk of the XML and it contains the default namespace and the above namespace. I can use the default like //x:Group/x:rule etc, but under rule is also the "dc" namespace. I either need to be able to grab that part also, or tell LibXML to ignore that section and give me everything else. The portion that is using the "dc" namespace is of no interest to me. I hope this makes sense.

      An example would probably help more. Anyway, have you tried the wildcards in XPath (Rule/*/text()) or the local-name() function?
      لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
        I do have an example in the original post. Can you not see it? Did I somehow not post it correctly? I am using a function like this:  for $Check ( $xc1->findvalue('//x:Rule') ) {

        If you cannot see the code in my original post let me know. I will repost the information. I have not tried the XPath (Rule/*/text()) or the local-name() function? Can you give me an example of how I would modify my code to try those? Thanks!