Antony
Antony

Reputation: 976

Marklogic - How to handle processing instruction in XML

I need to get the attribute value from XML using X Query . But this attribute like Processing instruction . So how to handle this kind of part?

     Sample XML:
        <root id="12">
        <?test date="3/1966"?>
        <?Names name="Anto. 17"?>
        <title>AUDIT</title>
        </root>

Expected output:
    date = "3/1966"

Upvotes: 2

Views: 146

Answers (1)

chrisis
chrisis

Reputation: 1993

If it looks like a processing instruction then it is.

For a specific processing instruction specify the target.

data(//processing-instruction(test))

All processing instructions

data(//processing-instruction())

Upvotes: 3

Related Questions