When using references, you may come across only one warning :
Warning : a reference points to an incorrect id : 'some_id'
It simply means that you tried to reference a box with the id some_id, but no
box has some_id as id
.
Open the existing XSL stylesheet editor/XML/XML/CDtoGRP.xsl
shipped with
TAXI. Add the line in bold at line number 163 :
<xsl:template match="cd" mode="reference"> <reference> <xsl:attribute name="source"> <xsl:value-of select="java:xml.XPointer.getXPointer(.)"/> </xsl:attribute> <xsl:attribute name="target"> <xsl:value-of select="generate-id()"/> <xsl:text>dummy</xsl:text> </xsl:attribute> </reference> <xsl:apply-templates select="author" mode="reference"/> <xsl:apply-templates select="title" mode="reference"/> <xsl:apply-templates select="song" mode="reference"/> </xsl:template>
In a console, change to directory editor/XML/XML
, and then type :
java -cp ../../lib/taxi.jar fr.loria.taxi.transformer.TransformerXMLToGRP -xml_in ex1.cd -xsl CDtoGRP.xsl -grp_dtd ../grp.dtd
You should see the following output :
Applying XSL transformations to file ex1.cd Warning : a reference points to an incorrect id : 'N916a2dummy' Warning : a reference points to an incorrect id : 'N2d77a7dummy' Generating GRP file ex1.cd.grp
Note : the id
s displayed in the warning messages may differ on
your machine, but they should be terminated by dummy
.
No box has neither the value N916a2dummy
or the value N2d77a7dummy
as identifier.
Effectively, when we create the box's id
, we don't put dummy
at the end of the identifier. We can see that at lines number 104-106 in
editor/XML/XML/CDtoGRP.xsl
:
<xsl:template match="cd" mode="box"> <vbox> <!-- Un CD --> <hbox background="whiteBackground"> <xsl:attribute name="id"> <xsl:value-of select="generate-id()"/> </xsl:attribute> ... </xsl:template>
Not to get these warnings again :
reference
,id
you try to point to,id
to a box.Modify editor/XML/XML/CDtoGRP.xsl
to put it back to the state it was
before. Simply delete the line 163 we added previously :
<xsl:template match="cd" mode="reference"> <reference> <xsl:attribute name="source"> <xsl:value-of select="java:xml.XPointer.getXPointer(.)"/> </xsl:attribute> <xsl:attribute name="target"> <xsl:value-of select="generate-id()"/> </xsl:attribute> </reference> <xsl:apply-templates select="author" mode="reference"/> <xsl:apply-templates select="title" mode="reference"/> <xsl:apply-templates select="song" mode="reference"/> </xsl:template>
Transform :
java -cp ../../lib/taxi.jar fr.loria.taxi.transformer.TransformerXMLToGRP -xml_in ex1.cd -xsl CDtoGRP.xsl -grp_dtd ../grp.dtd
You should get a clear output (no warnings) :
Applying XSL transformations to file ex1.cd Generating GRP file ex1.cd.grp