एक्सएमएल फ़ाइल 1 का उपयोग करने के लिए एक्सएमएल फ़ाइल परिवर्तित:एक और एक्सएमएल फ़ाइल XSLT
<?xml version="1.0"?>
<rentalProperties>
<property contact ="1">
<type>House </type>
<price>420</price>
<address>
<streetNo>1</streetNo>
<street>Wavell Street</street>
<suburb>Box Hill</suburb>
<state>VIC</state>
<zipcode>3128</zipcode>
</address>
<numberOfBedrooms>3</numberOfBedrooms>
<numberOfBathrooms>1</numberOfBathrooms>
<garage>1</garage>
</property>
एक्सएमएल फ़ाइल 2:
<?xml version="1.0"?>
<rentalProperties>
<property contact ="1">
<type>House </type>
<price>420</price>
<address>1 wavell street,Box Hill,VIC,Australia</address>
<numberOfBedrooms>3</numberOfBedrooms>
<numberOfBathrooms>1</numberOfBathrooms>
<garage>1</garage>
</property>
कैसे मैं एक्सएमएल fle 2 के लिए xml फ़ाइल 1 परिवर्तित xslt का उपयोग कर देना चाहिए? मैं पते को एक पंक्ति के रूप में प्रस्तुत करना चाहता हूं और लाइन के अंत में एक नई विशेषता [देश-ऑस्ट्रेलिया] जोड़ना चाहता हूं। मैंने बाकी सब किया। मैं पता पंक्ति के साथ संघर्ष कर रहा हूँ
XSLT फ़ाइल:
<address>
<xsl:for-each select="address/*">
<xsl:value-of select="."/>,
</xsl:for-each>
Australia
</address>
यह xml1 में पता टैग के सभी बच्चों से अधिक लूप:
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" type="text/css" href="style.css">
<xsl:template match="/">
<rentalProperties>
<property>
<xsl:attribute name="contact"><xsl:value-of select='@contact'/></xsl:attribute>
<type><xsl:value-of select="type"/></type>
<price><xsl:value-of select="price"/></price>
<numberOfBedrooms><xsl:value-of select="numberOfBedrooms"/></numberOfBedrooms>
<numberOfBathrooms><xsl:value-of select="numberOfBathrooms"/></numberOfBathrooms>
<garage><xsl:value-of select="garage"/></garage>
</property>
</rentalProperties>
</xsl:template>
</xsl:stylesheet>
यू बहुत बहुत – shavinda