Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 24th, 2006, 08:35 AM
Authorized User
 
Join Date: Jan 2006
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

 
Old January 24th, 2006, 09:14 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
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





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





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