[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Why aren't ENTITY declarations in a main styleshee
> I thought that an xs:include is essentially a "macro substitution", in > which case the entity declaration should be visible, yes? Nope. The XPath data model doesnbt have entities in it, so the parser expands them away. (In principle, the parser doesnbt have to, but the result wonbt work in XSLT if it doesnbt.) > I don't want to have ENTITY declarations scattered around multiple > files. What's the best way to deal with ENTITIES? If all your tooling will read the external subset, you can do something like this: <!DOCTYPE whatever SYSTEM "whatever.dtd" [ <!ENTITY % myDecls SYSTEM "decl.ent"> %myDecls; ]> <whatever> &spoon; </whatever> where decl.ent contains the entities, for example: <!ENTITY spoon "Spoon!"> You can get them into your XSLT that way too: <!DOCTYPE xsl:stylesheet [ <!ENTITY % myDecls SYSTEM "decl.ent"> %myDecls; ]> <xsl:stylesheet>b& But you have to do that in every file (including the ones you include or import). See also this note from ~20 years ago: https://norman.walsh.name/2003/09/27/dtds :-) Be seeing you, norm -- Norman Tovey-Walsh <ndw@xxxxxxxxxx> https://nwalsh.com/ > Why do politicians lie? Because it works. [demime 1.01d removed an attachment of type application/pgp-signature which had a name of signature.asc]
|
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
|