[xep-support] Using entities for images in XEP: SOLVED

Geurt Lagemaat Lagemaat at oriana-automatisering.com
Thu Jan 30 11:40:03 PST 2003


Nikolai, Eliot and Jeff,

Thank you for you're answers. The 

  <fo:external-graphic src="url({unparsed-entity-uri(@picfile)})"/>

solution works nicely. (It does function also without the url statement but
it generates a warning then). 

I do agree with Nikolai that there are easier solutions.

Yours,

Geurt Lagemaat
Oriana Automatisering


-----Oorspronkelijk bericht-----
Van: owner-xep-support at www.renderx.com
[mailto:owner-xep-support at www.renderx.com] Namens Jeff Beal
Verzonden: donderdag 30 januari 2003 16:56
Aan: 'xep-support at renderx.com'
Onderwerp: RE: [xep-support] Using entities for images in XEP 


The following XSL template will convert <dog picfile="colliepic"/> to fo.
The entity declaration is correct as is.

<xsl:template match="dog">
 <fo:block>
  <fo:external-graphic src="{unparsed-entity-uri(@picfile)}"/>
 </fo:block>
</xsl:template>

The key is the unparsed-entity-uri() function, which accepts a string that
is an entity name as an argument and returns a fully-qualified URI pointing
to the resource in question.  Again, you do not need the &name; syntax in an
attribute of type ENTITY, the attribute declaration is sufficient to let the
parser know the value to be an entity reference.

Jeff Beal

-----Original Message-----
From: Nikolai Grigoriev [mailto:grig at renderx.com]
Sent: Thursday, January 30, 2003 9:54 AM
To: xep-support at renderx.com
Subject: Re: [xep-support] Using entities for images in XEP 


Geurt,

> Does XEP support constructs like:
> 
> <?xml version="1.0"?>
> <!DOCTYPE dog [
>   <!NOTATION JPEG SYSTEM "Joint Photographic Experts Group">
>   <!ENTITY colliepic SYSTEM "lassie.jpg" NDATA JPEG>
>   <!ELEMENT dog EMPTY>
>   <!ATTLIST dog picfile ENTITY #REQUIRED>
> ]>
> <dog picfile="colliepic"/>


(It should be <dog picfile="&colliepic;"/>, shouldn't it?)

I don't know any method to use unparsed entities in XSL FO. 
Their status is quite special: an XML parser is expected
to "notify" the application when it encounters such an entity.
This "notification" can hardly be mapped to existing XSL 
data types.

> If it does, how to reference the image in this document in
> fo:external-graphic src=""?

No, it does not; but I wonder why do you need it, at all?
Won't it be simpler if you make your entity CDATA instead 
of NDATA? Something like this:

<!DOCTYPE dog [
  <!ENTITY colliepic "lassie.jpg">
  <!ELEMENT dog EMPTY>
  <!ATTLIST dog picfile ENTITY #REQUIRED>
]>

<dog picfile="&colliepic;"/>

----------
<xsl:template match="dog">
   .....
   <fo:external-graphic src="url({@picfile})"/>
  ....

Best regards,
Nikolai Grigoriev

-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo at renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service
http://www.renderx.com/tos.html
-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo at renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service
http://www.renderx.com/tos.html

-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo at renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/tos.html



More information about the Xep-support mailing list