Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Beginner's questions

From: Howard Brazee <howard@------.--->
To: NULL
Date: 8/2/2007 9:03:00 AM

On Thu, 2 Aug 2007 08:40:38 +0100, "Joe Fawcett"
<joefawcett@n...> wrote:

>Regarding your first point you can create an HTML/HTA page that will use the 
>iTunes.xml as a source and control the transformation via script, load the 
>XML into a DomDocument, the same with the XSLT and then transform the XML 
>and add the result to the page. There are examples of this in the msxml sdk.

It looks like I have a lot of research to do here.

>As to the actual transform I agree it's made tricky by the non-nested nature 
>of the XML but if you only want those three columns then you just need to 
>apply-templates to key elements and test the value or narrow down the 
>selection with a predicate:
><xsl:apply-templates select="key[. = 'Name']"/>
><xsl:apply-templates select="key[. = 'Rating']"/>
>
>You can then retrieve the first following-sibling:
><xsl:value-of select="following-sibling::*[1]"/>

That is similar to what I have done to get the header information:
================
      <xsl:template match='/'>
      <html><body>
      <h2>My iTune Collection
      	<xsl:apply-templates
select='/plist/dict/child::key[position()&lt;8]'/>
      </h2>

      <br/><br/><xsl:apply-templates select='/plist/dict/dict//dict'/>
      </body></html>
      </xsl:template>
====================

<xsl:template match='key'>
        <xsl:call-template name='showNextSiblingVal'>
            <xsl:with-param name='firstSiblingVal' select='.'/>
	</xsl:call-template>
</xsl:template>
 
<xsl:template name='showNextSiblingVal'>
        <xsl:param name='firstSiblingVal'/>
        <xsl:if test='. = $firstSiblingVal'>
           <br/><xsl:value-of select='.'/>:&#160;<xsl:value-of
select='following-sibling::*'/>
        </xsl:if>
</xsl:template>
=============================

I will play with it for my code within:
      <xsl:template match='dict'>
      	<xsl:for-each select='key'>
==============

How do I add a column which just has a sequence number?




transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent