[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: writing entity references.
Scott_Boag/CAM/Lotus@xxxxxxxxx wrote: > > (I can't post to the xsl-list because it doesn't like my Notes address, and I > can't seem to get this resolved). I guess using other mail software is out of the question. :) > > That strikes me as a bug. The entity reference in the stylesheet should be > > expanded and have absolutely *no relation* with an entity of the same name > > in the *output*. > > Good point. Let me tell you (as the author of LotusXSL) what I think is > happening. First, entities are maintain solely by XML4J (the supporting > parser). Second, I believe XML4J does not expand entity references: "The > object tree produced by the XML4J parser doesn't include GeneralReference Nodes > if the parser is configured as setExpandEntityReferences(false)... By default, > EntityReference Nodes are kept." So I should probably have a command line > switch that lets the user control whether or not setExpandEntityReferences is > set to false or true. It does seem to me a possible bug, that if > setExpandEntityReferences is set to false, and the entity that the reference > points to is not found, then it should just leave the entity reference, instead > of outputting nothing. > > I do think LotusXSL should have the entity references expanded by default for > all three trees (do you agree with this?), and I will fix that bug in the next > release. Probably the LotusXSL processor in setExpandEntityReferences(false) > mode would be a non-conformant processor. I agree. > Maybe. But what if you want entity references in the result tree, send them > across a pipe, and have the entities resolved locally? Are you saying there > should be no way to do this? It seems to me there should be (probably). (On > the other hand, I have no love of XML/SGML entities, so I would be happy enough > not to deal with them in the XSL processor). I know there was just a long > discussion (Re: More entity confusion and my opinion on the right way) that I > didn't track very well. Let me put it this way: if XSL is to allow entity references to appear in the output, it should do so with an <xsl:entity-ref> element. Choosing not to expand entity references on the input is certainly wrong and will conflice with the "XML data model" when it is defined (a year late). Turning this <![CDATA[&foo;]] into an entity reference would be rather arbitrary. After all, what are you going to do about this: Beware of <![CDATA[AT&T]]> If we really need entity references in the output (doubtful) then you (as a W3C member) should lobby the W3C to make <xsl:entity-ref>. Paul Prescod - ISOGEN Consulting Engineer speaking for only himself http://itrc.uwaterloo.ca/~papresco The United Nations Declaration of Human Rights will be 50 years old on December 10, 1998. These are your fundamental rights: http://www.udhr.org/history/default.htm XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|