xquery / xquerydoc

xquerydoc - generate XQuery API documentation from your source code comments
https://github.com/xquery/xquerydoc
Other
38 stars 11 forks source link

XQuery - Add Attribute to a Parent Element for the matching child tag #32

Open agankit opened 8 years ago

agankit commented 8 years ago

I have some set of predefined properties and their corresponding values in a excel format like -

and one input xml that is having various messages. I have to match each PROPNAMES with label value in message/message_type/command/cmd_input/param_block_series/param_block/param/param_name XPath for each messages and params we have in XML and add the new attribute with value as Property-value from excel to the parent of that matching param_name tag. For Example-

I have-

<param type="ENUM" optional="false" listable="false" rangeable="false" description="" default=""> <param_name label="PROPNAME1 " value="test-value1"> </param_name> </param>

i want to make above to :

<param type="ENUM" optional="false" listable="false" rangeable="false" description="" default="" **newAtt = "test-value1"**> <param_name label="PROPNAME1 " value="test-value1"> </param_name> </param>

and return the complete updated XML back from XQuery.Please Suggest some solution.