Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem with Entities and and XSL

5 views
Skip to first unread message

Michael_De...@adobeforums.com

unread,
Feb 17, 2009, 4:54:20 PM2/17/09
to
When working with images Framemaker generates the following when exporting to XML.

Ian_Pr...@adobeforums.com

unread,
Feb 17, 2009, 5:54:35 PM2/17/09
to
Hi Michael,

It's not clear if you are using the XSLT as part of the FrameMaker import/export process, to generate HTML, or some other process. However, the answer is the same in each case...

Use the xpath function unparsed-entity-uri() to return the URI of the referenced graphic file.

This could be used within your XSLT as follows when the context node is the symbol element: <xsl:value-of select="unparsed-entity-uri(@boardno)"/>.
Just use the result to populate the relevant attribute in the output document for example in HTML:
<img href="{unparsed-entity-uri(@boardno)}">

I hope this what you were looking for.

Best regards
Ian

Ian Proudfoot
iTP-X

Adobe Community Expert

Michael_Muell...@adobeforums.com

unread,
Feb 18, 2009, 5:31:46 AM2/18/09
to
Another option would be to not use the entity mechanics at all for XML output. You can achieve that by removing the entity attribute from the external DTD and the following read/write rules (among others):

element "image"
{
is fm graphic element;
attribute "entity" drop;
attribute "href" is fm property file;
}

This would give you something like

<image href="some file path" ... />

- Michael

Martti_...@adobeforums.com

unread,
Feb 18, 2009, 6:17:18 AM2/18/09
to
Michael,

The dtd change could be politically difficult in this case. The sample looks like airplane stuff, where the boardno is an entity type attribute, old remnant from the old ATA dtd.

Ian's solution definitely works (using the same..)

Martti

Michael_De...@adobeforums.com

unread,
Feb 18, 2009, 9:48:15 AM2/18/09
to
Thank you for help! That works great for the final result but I am getting an error on xml export... The values for boardno must be names or name tokens...any help on how to fix that and what that means would be great! Thanks again for all your help.

Martti_...@adobeforums.com

unread,
Feb 18, 2009, 2:47:23 PM2/18/09
to
Hi Michael,

Name token does not allow digits..I'd say that the problem is caused by the space in the graphics path that gets converted to %20.

If you cannot change the dtd, get rid of the space in the path.

BR, Martti

Michael_De...@adobeforums.com

unread,
Feb 19, 2009, 8:35:16 AM2/19/09
to
Thank you very much. I would never have guessed that!

Michael_De...@adobeforums.com

unread,
Mar 17, 2009, 11:26:00 AM3/17/09
to
I cannot get the img src to take the entity value...

this is the structure i am using...

<xsl:template match="symbol">
<xsl:element name="IMG">
<xsl:attribute name="SRC"><xsl:value-of select="unparsed-entity-uri(@boardno)"/></xsl:attribute>
<xsl:attribute name="ALIGN">middle</xsl:attribute>
</xsl:element>
</xsl:template>

the result is img src="" align=middle

Martti_...@adobeforums.com

unread,
Mar 18, 2009, 3:31:45 AM3/18/09
to
Hi Michael,

your xsl looks correct and should work (I've used the same with frame generated XML files but not with build-in XSLT).

Change the xsl to write the value of boardno to src attribute to see what value is returned. The only reason if could come up is that the local entity declarations are vanished when the XML is passed to XSLT.

Another try is to use, for example, saxon outside of frame env. to check that you get the unparsed value

BR, Martti

0 new messages