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)
-> + Add Condition check in a multi... (3)
-> + Eliminating Duplicates with XS... (3)
-> + Empty tags in XML (2)
-> + XML to XML transformations (5)
-> + XSLT problem (3)
-> + XSLT and Array (6)
-> + Problem with transforming XMLs... (3)
-> + Logging in XSLT? (3)
-> + svg can not view with msxml pr... (3)
-> + Newbie Sorting Question (5)
-> + xslt - get values from fist no... (5)
-> + RenderX logo at the buttom of ... (2)
-> + consolidate same nodes into on... (4)
-> + HOW DO I GET THE XSLT MAPPER? (2)
-> + Newbie - dublicating attribute... (2)
-> + Correct use of sum() (3)
-> + Using the sum() function (4)
-> - Prublem in XSLT (6)
-> ->Prublem in XSLT
-> ->Prublem in XSLT
-> ->Prublem in XSLT
-> ->Prublem in XSLT
-> ->Prublem in XSLT
-> + Newbie XPath Question (10)
-> + Reference to variable or param... (3)
-- Previous [1381-1400] [1401-1420] [1421-1440] 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.