on 12-18-2006 9:37 AM
Hi,
I am doing a simple xslt mapping wherein my Source data structure is
MT
|__ details
|__ Records
|_emp_no
|_ emp_name
|_emp_dno
In XSL file i hv specified <xsl:template match="MT">
and I am using <for-each select="details/Records">
when I m testing it in Interface mapping, it is giving me error "XML not well formed"
can anybody please suggest whats the problem in the code??
Thank you,
Anu Singhal
Am facing the same problem i tried the solution but in my case it didn't worked , please suggest me some solution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anu,
I think in the select query in xslt mapping u have to mention the expression "//" so that for each iteration it can go according the path.
< for-each select = " //details/records">
I have some sample code of same type...just check it..
<xsl:template match="/">
<MT_EMP_TARGET>
<xsl:for-each select="//EMP_DATA">
<EMP_DATA>
<xsl:variable name="fname" select="//EMP_DATA/First_Name"/>
<xsl:variable name="lname" select="//EMP_DATA/Last_Name"/>
<Emp_Code><xsl:value-of select="//EMP_DATA/Emp_Code"/></Emp_Code>
<Name><xsl:value-of select="concat($fname,' ',$lname)"/></Name>
<Join_Dt><xsl:value-of select="//EMP_DATA/Join_Dt"/></Join_Dt>
<Designation><xsl:value-of select="//EMP_DATA/Level"/></Designation>
<Dept><xsl:value-of select="//EMP_DATA/Dept"/></Dept>
</EMP_DATA>
</xsl:for-each>
</MT_EMP_TARGET>
</xsl:template>
For more info:
http://www.w3schools.com/xsl/el_for-each.asp
Cheers,
Prasanthi.
Reward marks if helpful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You could specify the Template match as MT/details too.
The value specified against parameter "match" depends on what you want in the target.
If you want all or some of the values starting after MT/details in your target, you need to specify match as MT/details
Else, if you want detail values too, you need to specify match as MT
Regards,
Smitha.
Message was edited by:
Smitha Rao
Hi Anu,
either your xml input document or your XSLT stylesheet is not well-formed. Here is an explanation of what 'well-formed' means:
http://en.wikipedia.org/wiki/XML#Well-formed_documents
If you still cannot solve it by yourself, just post your entire xml input document as well as your entire XSLT stylesheet and we can have a look.
Regards,
Matthias
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
open the test xml in IE and check if it is well formed.
In case of a well fomed XML the explorer will not throw an error.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.