on 07-04-2007 4:39 PM
hi,
I am Parsing source xml using SAX PARSER in JAVA MAPPING i am adding attribute to the root element but it is adding same attribute to the root as well as child also.
this is my sender structure
<Books>
<Book attribute="value">
<Title>title</Title>
<Author>
<First_Name>fname</First_Name>
<Last_Name>lname</Last_Name>
</Author>
<Price>100</Price>
</Book>
</Books>
TARGET STRUCTURE I AM GETTING IS
<Books>
<b><Book xmlns=""></b>
<attribute>value</attribute>
<Title>title</Title>
<Author_Name>fnamelname</Author_Name>
<Price>100</Price>
</Book>
</Books>
TARGET I NEED IS
<Books>
<b><Book></b>
<attribute>value</attribute>
<Title>title</Title>
<Author_Name>fnamelname</Author_Name>
<Price>100</Price>
</Book>
</Book>
u can see the diff is am getting an extra attribute created for me which i dont need.
You must use appropriate function call in the SAX parser API. Seems like you are using create node or element. Instead of this, check for a function which creates an attribute. Did not know this for sure, but logically thinking, the member function used to create and element must be different from attribute or you might have an optional parameter in the same function for specifying the attribute.
VJ
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Did u try running this ? Did it give error during runtime in XI ?? Check it...I think it may not give error
Also where are u generating target structure ..in end of document or for each element.. just to ask..
rgds,
Moorthy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.