Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Handling namespace and changing attribue values

Status
Not open for further replies.

sreekanta

Programmer
Joined
Apr 28, 2002
Messages
2
Location
IN
Hi
I have a XML data of following format

<a:Prod xmlns:a="Prod" action="D" type="Prod">
<ID>106</ID>
<VALUE>100</VALUE>
</a:Prod>

I want to parse this XML data and form a new data as follows
<a:Prod xmlns:a="Prod" action="U" type="Prod">
<Prod_sub>
<ID>106</ID>
</Prod_sub>
<VALUE>100</VALUE>
</a:Prod>

I have 2 questions for the above data.

1. I'm not able to put the namespace xmlns:a="Prod" when forming <a:Prod>. I'm able to put the action and type attributes in this tag. How to do this?

2. Now i want to change the value of the action to "U" if it's initial value is "D". if it is something otherthan "D" then i have to leave it as it is.

Plz let me know who should i do this

Thanks in advance
Sree
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top