![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: Beginner's questions >Thread Next - Re: Beginner's questions Re: Beginner's questionsTo: 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()<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='.'/>: <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? | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
