ThumbGen is a great little program for creating Info Sheet Pics for movies. I've been working on this for awhile.
I get the Error: "Attribute and namespace nodes cannot be added to the parent element after a text, comment, pi, or sub-element node has already been added."
I found this question on here, and have tried to use it as a basis:
Just Search for "xsl-and-xml-with-thumbgen" on here, as it won't let me post links, until my account is verified I guess.
But i'm getting the same error this guy WAS getting before the person answered it.
I tried to reply and comment on that question, but was unable too.
Anyhow, i'm not so great with XSL, i've never even heard of it, until just a few days ago.
Here is the XSLT file:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:variable name="pathvalue" select="//tokens/token[@name='%PATH%']"/>
<xsl:variable name="folderactors" select="string('\..\Common\cast\')"/>
<xsl:variable name="actorsext" select="string('.jpg')"/>
<xsl:variable name="actorstext" select="string('')"/>
<xsl:variable name="lista1" select="//tokens/token[@name='%ACTORS%']"/>
<xsl:variable name="actor1" select="substring-before($lista1, '/')" />
<xsl:variable name="resto1" select="substring-after($lista1, '/')" />
<xsl:variable name="lista2" select="$resto1"/>
<xsl:variable name="actor2" select="substring-before($lista2, '/')" />
<xsl:template match="ImageElement[@Name='Actor1']">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:choose>
<xsl:when test="$actor1 != '' ">
<xsl:attribute name="SourceData">
<xsl:value-of select="concat($pathvalue,$folderactors,$actor1,$actorsext)"/></xsl:attribute>
</xsl:when>
</xsl:choose>
<xsl:apply-templates select="node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
And here is the line in the XML that references it:
<ImageElement Name="Actor1" X="980" Y="44" Width="93" Height="123" Source="File" Offset="0" MultiPageIndex="-1" SourceData="" NullImageUrl="%PATH%\..\Common\cast\NoPhotoAvailable.jpg"></ImageElement>
If anyone is able to help me, I'd appriciate it. thank you.
I get the Error: "Attribute and namespace nodes cannot be added to the parent element after a text, comment, pi, or sub-element node has already been added."
I found this question on here, and have tried to use it as a basis:
Just Search for "xsl-and-xml-with-thumbgen" on here, as it won't let me post links, until my account is verified I guess.
But i'm getting the same error this guy WAS getting before the person answered it.
I tried to reply and comment on that question, but was unable too.
Anyhow, i'm not so great with XSL, i've never even heard of it, until just a few days ago.
Here is the XSLT file:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:variable name="pathvalue" select="//tokens/token[@name='%PATH%']"/>
<xsl:variable name="folderactors" select="string('\..\Common\cast\')"/>
<xsl:variable name="actorsext" select="string('.jpg')"/>
<xsl:variable name="actorstext" select="string('')"/>
<xsl:variable name="lista1" select="//tokens/token[@name='%ACTORS%']"/>
<xsl:variable name="actor1" select="substring-before($lista1, '/')" />
<xsl:variable name="resto1" select="substring-after($lista1, '/')" />
<xsl:variable name="lista2" select="$resto1"/>
<xsl:variable name="actor2" select="substring-before($lista2, '/')" />
<xsl:template match="ImageElement[@Name='Actor1']">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:choose>
<xsl:when test="$actor1 != '' ">
<xsl:attribute name="SourceData">
<xsl:value-of select="concat($pathvalue,$folderactors,$actor1,$actorsext)"/></xsl:attribute>
</xsl:when>
</xsl:choose>
<xsl:apply-templates select="node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
And here is the line in the XML that references it:
<ImageElement Name="Actor1" X="980" Y="44" Width="93" Height="123" Source="File" Offset="0" MultiPageIndex="-1" SourceData="" NullImageUrl="%PATH%\..\Common\cast\NoPhotoAvailable.jpg"></ImageElement>
If anyone is able to help me, I'd appriciate it. thank you.