[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Lost Attributes?

Subject: Lost Attributes?
From: Mike Ferrando <mikeferrando@xxxxxxxxx>
Date: Tue, 5 Mar 2002 10:50:36 -0800 (PST)
title attribute lost
Dear friends,
I cannot figure out what happened to my stylesheet. I was doing
great, but now I cannot get my attributes back. Maybe someone could
put their finger on it. Below is my output, my xml and my xsl.

I have truncated these documents so that this will not be such a long
e-mail. 

I did have this all working, but now it does not work.

Mike F.

OUTPUT:===================

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE C03
  SYSTEM "Rodgers1.dtd">
<C03 LEVEL="collection">
   <DID>
      <UNITTITLE>
         <TITLE NORMAL="" LINK="" RENDER="">Allegro</TITLE>
(<UNITDATE NORMAL="" LABEL="" CERTAINTY="">1947</UNITDATE>) lyrics by
<PERSNAME ENCODINGANALOG="700$a" ROLE="lyr" NORMAL="Hammerstein,
Oscar">Oscar Hammerstein</PERSNAME> II</UNITTITLE>
   </DID>
   <C04>
      <DID>
         <CONTAINER TYPE="box-folder">1/1</CONTAINER>
         <UNITTITLE>
            <TITLE ENCODINGANALOG="246$a"
NORMAL="Allegro">Allegro</TITLE>
         </UNITTITLE>
      </DID>
      <ODD>
         <C1005 ENCODINGANALOG="">
            <P>Holograph sketch in pencil ; 3 p.</P>
         </C1005>
         <C1007 ENCODINGANALOG="">
            <P>Includes: [3] p. of unidentified holograph sketches,
one dated as:  <DATE NORMAL="19430701" LABEL="">July 1, '43</DATE>
            </P>
         </C1007>
      </ODD>
   </C04>
   <C04>
      <DID>
         <CONTAINER TYPE="box-folder">1/1</CONTAINER>
         <UNITTITLE>
            <TITLE ENCODINGANALOG="246$a"
NORMAL="Allegro">Allegro</TITLE>
         </UNITTITLE>
      </DID>
      <ODD>
         <C1005 ENCODINGANALOG="">
            <P>Holograph piano-vocal score in pencil ; [8] p.</P>
         </C1005>
         <C1006 ENCODINGANALOG="">
            <P>Laid in: typescript lyric sheet ; [2] p.</P>
         </C1006>
      </ODD>
   </C04>
</C03>
<C03 LEVEL="collection">
   <DID>
      <UNITTITLE>
         <TITLE NORMAL="" LINK="" RENDER="">The American Idea</TITLE>
(<UNITDATE LABEL="television" NORMAL="" CERTAINTY="">1973</UNITDATE>)
television score</UNITTITLE>
   </DID>
   <C04>
      <DID>
         <CONTAINER TYPE="box-folder">1/22</CONTAINER>
         <UNITTITLE>
            <TITLE ENCODINGANALOG="246$a" NORMAL="The American
idea">The American idea : main title theme</TITLE>
         </UNITTITLE>
      </DID>
      <ODD>
         <C1005 ENCODINGANALOG="">
            <P>Holograph condensed score in pencil ; 2 p.</P>
         </C1005>
         <C1007 ENCODINGANALOG="">
            <P>Note:  dated Oct. <DATE NORMAL="" LABEL="">1972</DATE>
            </P>
         </C1007>
      </ODD>
   </C04>
</C03>

XML:==========================

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE RODGERS1>

<RODGERS1>
<SHOW>
<C1001><TITLE>Allegro</TITLE> (<UNITDATE>1947</UNITDATE>) lyrics by
<PERSNAME ENCODINGANALOG="700$a" ROLE="lyr" NORMAL="Hammerstein,
Oscar">Oscar Hammerstein</PERSNAME> II</C1001>

<SONG><C1002>Allegro</C1002>
<SCORE><C1003>1/1</C1003><C1004>Allegro</C1004><C1005 SC300="1 ms. of
music (3 p.)">Holograph sketch in pencil ; 3
p.</C1005><C1007>Includes: [3] p. of unidentified holograph sketches,
one dated as:  <DATE NORMAL="19430701">July 1,
'43</DATE></C1007></SCORE>
<SCORE><C1003>1/1</C1003><C1004>Allegro</C1004><C1005 SC300="1 ms.
vocal score ([8] p.)">Holograph piano-vocal score in pencil ; [8]
p.</C1005><C1006>Laid in: typescript lyric sheet ; [2]
p.</C1006></SCORE>
</SONG>
</SHOW>

<SHOW>
<C1001><TITLE>The American Idea</TITLE> (<UNITDATE
LABEL="television">1973</UNITDATE>) television score</C1001>

<SONG><C1002>The American idea</C1002>
<SCORE><C1003>1/22</C1003><C1004>The American idea : main title
theme</C1004><C1005 SC300="1 ms. condensed score (2 p.)">Holograph
condensed score in pencil ; 2 p.</C1005><C1007>Note:  dated Oct.
<DATE>1972</DATE></C1007></SCORE>
</SHOW>
</RODGERS1>

XSL:=================================

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet   version="1.0"  
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output version="1.0" method="xml" indent="yes" encoding="utf-8"
omit-xml-declaration="no" standalone="no"
doctype-system="Rodgers1.dtd" media-type="text/xml"/>

  <xsl:template match="/">
    <xsl:for-each select="//SHOW">
      <xsl:element name="C03">
      <xsl:attribute name="LEVEL">collection</xsl:attribute>
        <xsl:apply-templates select="C1001"/>
        <xsl:apply-templates select="SONG"/>
      </xsl:element>  
    </xsl:for-each>
  </xsl:template>

<xsl:template match="SONG">
    <xsl:apply-templates select="SCORE"/>
    <xsl:apply-templates select="SKETCH"/>
    <xsl:apply-templates select="MMUSIC"/>
</xsl:template>

<xsl:template match="SCORE">
  <xsl:choose>
    <xsl:when test="C1012">
      <xsl:apply-templates select="C1012"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:apply-templates select="C1002"/>
      <xsl:element name="C04">
        <xsl:element name="DID">
          <xsl:apply-templates select="C1003"/>
          <xsl:element name="UNITTITLE">
              <xsl:element name="TITLE">
              <xsl:attribute
name="ENCODINGANALOG">246$a</xsl:attribute>
              <xsl:attribute name="NORMAL"><xsl:copy-of
select="../C1002/node()"/></xsl:attribute>
                <xsl:copy-of select="C1004/node()"/>
              </xsl:element>
              <xsl:apply-templates select="C1010"/>
              <xsl:apply-templates select="C1011"/>
          </xsl:element>
        </xsl:element>
          <xsl:apply-templates select="C1005" mode="hey"/>
        <xsl:element name="ODD">
            <xsl:apply-templates select="C1005 | C1006 | C1007 |
C1009"/>
        </xsl:element>
      </xsl:element>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

<xsl:template match="C1005 | C1006 | C1007">
  <xsl:element name="{name()}">
  <xsl:attribute name="ENCODINGANALOG">
    <xsl:value-of select="../@LINK"/>
  </xsl:attribute>
      <xsl:element name="P">
        <xsl:copy-of select="node()"/>
      </xsl:element>
  </xsl:element>
</xsl:template>

<xsl:template match="C1005" mode="hey">
  <xsl:element name="{name()}">
    <xsl:attribute name="ENCODINGANALOG"><xsl:copy-of
select="node()"/></xsl:attribute>
    <xsl:value-of select="@SC300"/>
  </xsl:element>
</xsl:template>

</xsl:stylesheet>

__________________________________________________
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.