Skip to content

How to get the raw XML content under a node #58

@marcelotto

Description

@marcelotto

I want to parse the result of a SPARQL XML result like this:

<sparql xmlns="http://www.w3.org/2005/sparql-results#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/sw/DataAccess/rf1/result2.xsd">
  <head>
    <variable name="blurb"/>
  </head>
  <results>
    <result>
      <binding name="blurb">
        <literal datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral">
          <p xmlns="http://www.w3.org/1999/xhtml">My name is <b>alice</b></p>
        </literal>
      </binding>
    </result>
  </results>
</sparql>

and get everything under the literal node as a string, i.e. <p xmlns="http://www.w3.org/1999/xhtml">My name is <b>alice</b></p>.

Is this possible with SweetXML somehow?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions