If I run a Marklogic Query, I would like to return specific data from the XML.

If the XML in the DB looks like this:

 

<results>

    <interface id="345">

        <description>Test Interface A</description>

    </interface>
    <interface id="678">

        <description>Test Interface A</description>

    </interface>
</results>

 

I would like to only return the id attribute and description of the interface 
tag

 

I have tried doing something like this:

 

$query...

 

return

<item>

    {$docs/interface/@id}

    {$docs/interface/description}

</item>

 

But i get an error that loks like this:

$docs/interface/@id -- Two attributes with the same name


Any ideas how I get only return the id attribute ?

 

-Tony Mariella


 


                                          
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to