Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xsl] Replacing values in xml files.....

From: "Mujahid - E - Azam" <mujahidazam@------------>
To:
Date: 1/2/2008 11:10:00 AM
Can you please help me with the syntax...  
Also can you please go through the xsl at the bottom and let me know if I am
going in the right direction....

Thanks & Regards,

Mujahid E Azam


 

-----Original Message-----
From: Mukul Gandhi [mailto:gandhi.mukul@xxxxxxxxx] 
Sent: Wednesday, January 02, 2008 4:02 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] Replacing values in xml files.....

You can fulfil this requirement using the 'document' function.

I think some of us provided information about 'document' function for
a similar question posted by you.

Did you attempt to learn the semantics of 'document' function ? I am
sure, it'll solve this problem ...

On Jan 2, 2008 2:41 PM, Mujahid - E - Azam <mujahidazam@xxxxxxxxxxxx> wrote:
> HI,
>
> I have two xml files.... (xsl below....)
> ************* 1 ***************
> <?xml version="1.0" encoding="UTF-8"?>
> <wikimedia>
> <projects>
> <project name="Wikipedia" launch="2001-01-05"> <editions> <edition
> language="English">p1</edition> <edition
> language="German">de.wikipedia.org</edition>
> </editions>
> </project>
> <project name="Wiktionary" launch="2002-12-12"> <editions> <edition
> language="English">en.wiktionary.org</edition>
> </editions>
> </project>
> </projects>
> </wikimedia>
> ************end of 1****************
>
> and
>
> *****************2****************
>
> <?xml version="1.0" encoding="UTF-8"?>
> <chapter>
> <p id="p1">text</p>
> </chapter>
> *********end of 2****************
> If you see the 1 st xml file
> At the node wikimedia\ projects\ project\ editions\ edition
> language="English" in the place of p1. I should get value from the second
> xml file ----- chapter\<p id="p1"> "text".
> When I run an xslt and get the data from 1st xml in the place of p1. I
> should get text displayed..
> I mean it should be linked to the chapter\<p id="p1"> "text". Field of
> source.xml..
> please let me know how to do this.....
> I am not sure if this is even correct.. I am completely new to xsl...
so...
> The xsl I have come up with so far is...
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:s="www.---.com;
>
>        <xsl:template match="/">
>        <html>
>            <head/>
>            <body>
>                <xsl:variable name="DefaultDocument" select="."/>
>                <div style="text-align: none;">
>                    <div>
>                        <div style="text-align: none;">
>                            <xsl:for-each
> select="$DefaultDocument//wikimedia/projects/project">
>                                <xsl:variable name="project" select="."/>
>                                <div>
>                                    <div style="text-align: none;">
>                                        <xsl:value-of select="@name"/>
>                                        <xsl:text>-</xsl:text>
>                                        <div>
>                                            <div style="text-align: none;">
>                                                <xsl:value-of
> select="editions"/>
>                                                <div>
>                                                    <div style="text-align:
> none;">
>                                                        <div>
>                                                            <div
> style="text-align: none;">
>
> <xsl:for-each select=".">
>
> <xsl:variable name="project" select="."/>
>                                                                    <div
> style="text-align: none;">
>
> <xsl:for-each select="editions/edition">
>
> <xsl:variable name="edition" select="."/>
>
> <div>
>
> <div style="text-align: none;">
>
> <xsl:choose>
>
> <xsl:when test="wikimedia/projects/project/editions/edition = 'p1'">
>
> <div style="text-align: none;">
>
> <div style="text-align: none;">
>
>
> <xsl:text>yes</xsl:text>
>
> </div>
>
> </div>
>
> </xsl:when>
>
> <xsl:otherwise>
>
> <div style="text-align: none;">
>
> <div style="text-align: none;">
>
> <xsl:text>no</xsl:text>
>
> </div>
>
> </div>
>
> </xsl:otherwise>
>
> </xsl:choose>
>
> <xsl:text> --</xsl:text>
>
> <xsl:value-of select="."/>
>
> </div>
>
> </div>
>
> </xsl:for-each>
>                                                                    </div>
>
> </xsl:for-each>
>                                                            </div>
>                                                        </div>
>                                                    </div>
>                                                </div>
>                                            </div>
>                                        </div>
>                                        <div>
>                                            <div style="text-align: none;">
>                                                <xsl:value-of
> select="@launch"/>
>                                            </div>
>                                        </div>
>
> <xsl:text>*******************************</xsl:text>
>                                    </div>
>                                </div>
>                            </xsl:for-each>
>                        </div>
>                    </div>
>                </div>
>            </body>
>        </html>
>    </xsl:template>
> </xsl:stylesheet>
>
> Thanks & Regards,
>
> Mujahid E Azam


-- 
Regards,
Mukul Gandhi


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent