Skip to content
This repository was archived by the owner on Sep 3, 2020. It is now read-only.
This repository was archived by the owner on Sep 3, 2020. It is now read-only.

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

@agankit

Description

@agankit

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

  • PROPNAME1 test-value1
  • PROPNAME2 test-value2

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions