XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
- XSLT Help and Discussion (7625)
-> + Use of before and after string (3) Sticky Topic
-> - How do I substitute element ty... (1)
-> + How does one add working days ... (4)
-> - Help, I have existing XLT and... (1)
-> + Need help on XSLT issue - (2)
-> + EDI to XML Conversion (7)
-> - XML To JSON Conversion using X... (1)
-> + Formatting Paragraphs to same ... (2)
-> - Grouping of records (1)
-> + Problems with xsd 1.1 (4)
-> + XML to HL7 mapping (3)
-> + XSLT 3 and Iterate (2)
-> + XSL-FO to PDF preview (3)
-> + java.lang.RuntimeException: Er... (2)
-> + Create Acroforms with Stylus X... (2)
-> + How to change XSLT parameter s... (3)
-> + how to change format of the da... (2)
-> + Search "Next 8 Results " doesn... (2)
-> - Support for Git (1)
-> + newbee (8)
-- [1-20] [21-40] [41-60] Next
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
misha tsvetSubject: Prublem in XSLT
Author: misha tsvet
Date: 04 Aug 2006 04:35 PM
Originally Posted: 04 Aug 2006 04:30 PM
i have such input.
<records>
<record>
<ADDED_XML>motorola_Norway.xml</ADDED_XML>
<ADDED_MANUF>Motorola<ADDED_MANUF>
<ADDED_NAME>gidra</ADDED_NAME>
<ADDED_URL>http://direct.motorola.com/nrn/phoneselect.asp?country=NRW&#x26;amp;language=NRN&#x26;amp;productid=30385&#x26;amp;web_page_name=OTHERPHONE</ADDED_URL>
<REMOVED_MANUF>Motorola</REMOVED_MANUF>
<REMOVED_NAME>L2</REMOVED_NAME>
<REMOVED_URL>http://direct.motorola.com/nrn/phoneselect.asp?country=NRW&#x26;amp;language=NRN&#x26;amp;productid=30385&#x26;amp;web_page_name=OTHERPHONE
</REMOVED_URL>
</record>
<record>
<ADDED_XML>motorola_Norway.xml</ADDED_XML>
<ADDED_MANUF>Motorola</ADDED_MANUF>
<ADDED_NAME>L226</ADDED_NAME>
<ADDED_URL>http://direct.motorola.com/nrn/phoneselect.asp?country=NRW&#x26;amp;language=NRN&#x26;amp;productid=30385&#x26;amp;web_page_name=OTHERPHONE
</ADDED_URL>
<REMOVED_MANUF>Motorola</REMOVED_MANUF>
<REMOVED_NAME>L2</REMOVED_NAME>
<REMOVED_URL>http://direct.motorola.com/nrn/phoneselect.asp?country=NRW&#x26;amp;language=NRN&#x26;amp;productid=30385&#x26;amp;web_page_name=OTHERPHONE
</REMOVED_URL>
</record>

I need to get such stucture:
<changes file="1.xml">
<added>
<device name="1" src-url="2"/>
<device name="3" src-url="4"/>
</added>
<removed>
<device name="5" src-url="6"/>
<device name="7" src-url="8"/>
</removed
</changes>
<changes file="2.xml">
<added>
<device name="12" src-url="23"/>
<device name="34" src-url="45"/>
</added>
<removed>
<device name="56" src-url="67"/>
<device name="78" src-url="89"/>
</removed
</changes>

I write such sctipt:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:key name="records" match="records/record" use="concat(ADDED_XML,ADDED_MANUF, ADDED_NAME,ADDED_URL,REMOVED_MANUF,REMOVED_NAME,REMOVED_URL)"/>
<xsl:template match="/">
<device-diff>
<xsl:for-each select="/records/record[generate-id() = generate-id(key('records', concat(ADDED_XML,ADDED_MANUF, ADDED_NAME,ADDED_URL,REMOVED_MANUF,REMOVED_NAME,REMOVED_URL))[1])]">
<changes file="{ADDED_XML}">
<added>
<xsl:variable name="keyVal" select="concat(ADDED_XML,ADDED_MANUF, ADDED_NAME,ADDED_URL,REMOVED_MANUF,REMOVED_NAME,REMOVED_URL)"/>
<xsl:for-each select="/records/record[concat(ADDED_XML,ADDED_MANUF, ADDED_NAME,ADDED_URL,REMOVED_MANUF,REMOVED_NAME,REMOVED_URL) = $keyVal]">
<device manufacturer="{ADDED_MANUF}" name="{ADDED_NAME}" src-url="{ADDED_URL}"/>
</xsl:for-each>
</added>
<removed>
<xsl:variable name="keyVal" select="concat(ADDED_XML,ADDED_MANUF, ADDED_NAME,ADDED_URL,REMOVED_MANUF,REMOVED_NAME,REMOVED_URL)"/>
<xsl:for-each select="/records/record[concat(ADDED_XML,ADDED_MANUF, ADDED_NAME,ADDED_URL,REMOVED_MANUF,REMOVED_NAME,REMOVED_URL) = $keyVal]">
<device manufacturer="{REMOVED_MANUF}" name="{REMOVED_NAME}" src-url="{REMOVED_URL}"/>
</xsl:for-each>
</removed>
</changes>
</xsl:for-each>
</device-diff>
</xsl:template>
</xsl:stylesheet>

But i get :
<changes file="motorola_Norway.xml">
<added>
<device manufacturer="Motorola" name="gidra" src-url="http://direct.motorola.com/nrn/phoneselect.asp?country=NRW&amp;amp;language=NRN&amp;amp;productid=30385&amp;amp;web_page_name=OTHERPHONE"/>
</added>
<removed>
<device manufacturer="Motorola" name="L2" src-url="http://direct.motorola.com/nrn/phoneselect.asp?country=NRW&amp;amp;language=NRN&amp;amp;productid=30385&amp;amp;web_page_name=OTHERPHONE"/>
</removed>
</changes>
<changes file="motorola_Norway.xml">
<added>
<device manufacturer="Motorola" name="L226" src-url="http://direct.motorola.com/nrn/phoneselect.asp?country=NRW&amp;amp;language=NRN&amp;amp;productid=30385&amp;amp;web_page_name=OTHERPHONE"/>
</added>
<removed>
<device manufacturer="Motorola" name="L2" src-url="http://direct.motorola.com/nrn/phoneselect.asp?country=NRW&amp;amp;language=NRN&amp;amp;productid=30385&amp;amp;web_page_name=OTHERPHONE"/>
</removed>
</changes>

PLz help me.

Postnext
misha tsvetSubject: Prublem in XSLT
Author: misha tsvet
Date: 04 Aug 2006 04:39 PM
And also can i made case-INsensitive sort using XSLT?

Postnext
misha tsvetSubject: Prublem in XSLT
Author: misha tsvet
Date: 10 Aug 2006 12:14 PM
Did anyone know how to do it?

Postnext
Minollo I.Subject: Prublem in XSLT
Author: Minollo I.
Date: 10 Aug 2006 01:01 PM
Misha,
what Stylus Studio version and build are you running? (Help > About)

Postnext
misha tsvetSubject: Prublem in XSLT
Author: misha tsvet
Date: 10 Aug 2006 03:54 PM
stylus-studio-enterprise-7r2
But i use it like speadsheet to WebQl 3.0

Posttop
Minollo I.Subject: Prublem in XSLT
Author: Minollo I.
Date: 10 Aug 2006 04:06 PM
Misha,
I may well be wrong, but from the data we have it would look like your Stylus Studio evaluation expired on 6/19/2006.

If you are still using Stylus Studio and you have a valid activation key, can you please email that information to stylus-field-report@progress.com?

Thanks!

   
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.