on 01-25-2006 10:42 AM
Hi,
I need to Access the Element's name in Message mapping (Using graphical tool or in user defined function).
For Example:
Element: <Company_Name>XYZ Co </Company_Name>
I need to access the Element's name(i.e.)<b>"Company_Name"</b>. So that I can map it as
<Element>Company_Name</Element>
<Element_Value>XYZ Co </Element_Value>
in the target message.
Kindly provide your inputs.
Hi,
You will definitely know the name of the node when u are doing the mapping for that particular source to target structure. So what is the special need to get the elements name.
Regards,
Sudharshan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thanks for your Inputs on reading Source element's name.
How to read the target element's name?, kindly explain
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Santhosh,
this is definitively not possible.
The mapping tool does not store the name of the source tag, so you cannot access the name.
The only thing you can read is the name of the target tag, but I think this will not help you in your case.
Regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thanks for your input.I am not using Java mapping in this case.So how can I access the element's name inside a User Defined function which inturn can be helpful in Graphical mapping.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Santhosh,
I am not very sure if this can be done in your normal graphical mapping.
Even while writing a user defined function, in Graphical mapping, the input to that function is going to be the value of an element and not the name of the element.
Consider,
<b><elem> yyy </elem></b>
if this is given as the input to your user defined function, the value <b>yyy</b> will be passed as an input and <b>not the name of the element</b> "elem".
So, the most logical solution would be to go for java mapping.
Regards,
Bhavesh
Hi Santhosh,
I am not sure if this can be done using your Graphical Mapping, but this is possible using JAVA mapping. Your SAX and DOM parsers for JAVA mapping provides methods like getChildNodes, getElementName using which you can get the name of the element.
Check this link for the methods available for Java Mapping,
http://java.sun.com/j2se/1.4.2/docs/api/javax/xml/parsers/package-summary.html
I think the same can also be done using XSL mapping. Though, I am not sure what method should be used for the same.
Hope this helps,
Regards,
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Santhosh,
For a list of all the methods available and their description for a DOM parser for JAVA Mapping, chek out these links,
http://java.sun.com/j2se/1.4.2/docs/api/org/w3c/dom/Document.html
http://java.sun.com/j2se/1.4.2/docs/api/org/w3c/dom/package-frame.html
Using these methods, you will be definitely be able to access the element name.
Regards,
Bhavesh
Hi,
Thanks for your input. I don't want to use a Constant with the Element's name and map it to target <Element>, but instead I need to access the Element's name and then map it.
I need to map nearly 220 elements like this, So I am looking at accessiing the elements's name to make the mapping easier.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.