Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 24th, 2006, 08:35 AM
Authorized User
 
Join Date: Jan 2006
Location: tel aviv, israel, Israel.
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default more direct Question, need help

this is my xml file (input file). what is the xsl file that I need to write in order to get the output that is written below? (please help)

<root>
    <imports/>
    <entities>
        <entity key="common">
            <launching>
                <parameters-activity>
                    <values>
                        <value parameter-name="launched-product-code" parameter-value="IS"/>
                        <value parameter-name="apptier-id" parameter-value="!~apptier_id!~"/>
                        <value parameter-name="timeFrame" parameter-value="!~timeframe!~"/>
                        <value parameter-name="sort" parameter-value="OO_TT"/>
                        <value parameter-name="display" parameter-value="overview"/>
                    </values>
                </parameters-activity>
            </launching>
        </entity>
        <entity key="Instance">
            <launching>
                <parameters>
                    <values>
                        <value parameter-name="launched-product-code" parameter-value="IS"/>
                        <value parameter-name="apptier-id" parameter-value="!~apptier_id!~"/>
                        <value parameter-name="timeFrame" parameter-value="!~timeframe!~"/>
                        <value parameter-name="sort" parameter-value="OO_TT"/>
                        <value parameter-name="display" parameter-value="overview"/>
                        <value parameter-name="drilldown" parameter-value="&lt;drilldowns&gt;&lt;drilldown field=&quot;instance&quot; value=&quot;!~instance!~&quot; id=&quot;instance_id&quot; id_value=&quot;!~instance_id!~&quot;/&gt;&lt;/drilldowns&gt;"/>
                        <value parameter-name="entityType" parameter-value="program"/>
                    </values>
                </parameters>
            </launching>
        </entity>
        <entity key="Client IP">
            <launching>
                <parameters>
                    <values>
                        <value parameter-name="launched-product-code" parameter-value="IS"/>
                        <value parameter-name="apptier-id" parameter-value="!~apptier_id!~"/>
                        <value parameter-name="sort" parameter-value="OO_TT"/>
                        <value parameter-name="display" parameter-value="overview"/>
                        <value parameter-name="drilldown" parameter-value="&lt;drilldowns&gt;&lt;drilldown field=&quot;instance&quot; value=&quot;!~instance!~&quot; id=&quot;instance_id&quot; id_value=&quot;!~instance_id!~&quot;/&gt;
                        &lt;drilldown field=&quot;client_ip&quot; value=&quot;!~entity!~&quot; id=&quot;client_ip_id&quot; id_value=&quot;!~entity_id!~&quot;/&gt;&lt;/drilldowns&gt;"/>
                        <value parameter-name="entityType" parameter-value="program"/>
                    </values>
                </parameters>
            </launching>
        </entity>
    </entities>
</root>

to get this out put

<root>
    <imports/>
    <entities>
        <entity key="common">
            <launching>
                <parameters-activity>
                    <values>
                        <value parameter-name="launched-product-code" parameter-value="IS"/>
                        <value parameter-name="apptier-id" parameter-value="!~apptier_id!~"/>
                        <value parameter-name="timeFrame" parameter-value="!~timeframe!~"/>
                        <value parameter-name="sort" parameter-value="OO_TT"/>
                        <value parameter-name="display" parameter-value="overview"/>
                    </values>
                </parameters-activity>
            </launching>
        </entity>
        <entity key="Instance">
            <launching>
                <parameters>
                    <values>
                        <value parameter-name="launched-product-code" parameter-value="IS"/>
                        <value parameter-name="apptier-id" parameter-value="!~apptier_id!~"/>
                        <value parameter-name="timeFrame" parameter-value="!~timeframe!~"/>
                        <value parameter-name="sort" parameter-value="OO_TT"/>
                        <value parameter-name="display" parameter-value="overview"/>
                        <value parameter-name="drilldown" parameter-value="&lt;drilldowns&gt;&lt;drilldown field=&quot;instance&quot; value=&quot;!~instance!~&quot; id=&quot;instance_id&quot; id_value=&quot;!~instance_id!~&quot;/&gt;&lt;/drilldowns&gt;"/>
                        <value parameter-name="entityType" parameter-value="program"/>
                    </values>
                </parameters>
            </launching>
        </entity>
        <entity key="Client IP">
            <launching>
                <parameters>
                    <values>
                        <value parameter-name="launched-product-code" parameter-value="IS"/>
                        <value parameter-name="timeFrame" parameter-value="!~timeframe!~"/>
                        <value parameter-name="sort" parameter-value="OO_TT"/>
                        <value parameter-name="compare" parameter-value="overview"/>
                        <value parameter-name="context" parameter-value="&lt;navigation-name&gt;&lt;predicate apptierId=&quot;!~apptier_id!~&quot; key=&quot;instance&quot;&gt;&lt;value&gt;!~instanc e!~&lt;/value&gt;&lt;/predicate&gt;&lt;/navigation-name&gt;&lt;navigation-id&gt;&lt;predicate apptierId=&quot;!~apptier_id!~&quot; key=&quot;instance_id&quot;&gt;&lt;value&gt;!~inst ance_id!~&lt;/value&gt;&lt;/predicate&gt;&lt;/navigation-id&gt;&lt;navigation-tooltip&gt;&lt;predicate key=&quot;client_ip&quot; display=&quot;TU-client_ip&quot; &gt;&lt;value&gt;&lt;![CDATA[!~entity!~]]&gt;&lt;/value&gt;&lt;/predicate&gt;&lt;/navigation-tooltip&gt;"/>
                        <value parameter-name="associate" parameter-value="program"/>
                    </values>
                </parameters>
            </launching>
        </entity>
    </entities>
</root>

thank you

Reply With Quote
  #2 (permalink)  
Old January 24th, 2006, 09:14 AM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

This is like a "spot the differences" competition in a child's picture-book. You need to explain the rules that drive the transformation. Why is the drilldown property omitted when it's part of "Client IP" but not when it's part of "Instance", for example? Unless you know the rules, I could just write a stylesheet that generates the output regardless what the input is.

You also need to explain where you are having difficulty with your XSLT coding. It doesn't look like a difficult problem, so to help you, I need to understand which part of the language you are having difficulty with.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
avoid direct acces austinf Javascript 1 June 19th, 2006 06:37 AM
Direct Child Selector Question - P86-87 MRoberts BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 1 May 22nd, 2005 04:48 PM
direct connection to database Regornil Linux 0 September 23rd, 2004 09:28 PM
Direct X SDK krishnabhargav General .NET 0 September 21st, 2004 08:42 AM
Direct Printing from ASP kbaker Classic ASP Basics 1 April 19th, 2004 11:50 AM



All times are GMT -4. The time now is 01:53 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.