[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
Re: [xml-dev] Best Practice: id-idref or external entities?
- From: Daniela Florescu <dflorescu@mac.com>
- To: "Costello, Roger L." <costello@mitre.org>
- Date: Thu, 08 Oct 2015 14:10:56 +0200
My personal point of view would be very simple to express: avoid them if you can.
They mix very badly with XQuery and co.
Best regards
Dana
Sent from my iPhone
> On Oct 8, 2015, at 2:06 PM, Costello, Roger L. <costello@mitre.org> wrote:
>
> Hi Folks,
>
> What is your experience with using id-idref? Good experience? Bad experience? It seems to me that the id-idref pair has a lot of resemblances to GOTOs, which implies that it might be wise to avoid id-idref.
>
> An alternative to using id-idref is to use external entities. What is your experience with using external entities? Good experience? Bad experience? It seems to me that external entities have a lot of resemblances to macro expansion, which is used with good effect in assembly programming, which implies that it might be good to use external entities.
>
> Below are two examples: the first uses id-idref and the second uses external entities. Which approach do you prefer? Or perhaps there is another approach that you prefer? /Roger
>
> ----------------------------------------------
> id-idref
> ----------------------------------------------
> <Books>
> <Book>
> <Author idref="RB" />
> <Title>Illusions: The Adventures of a Reluctant Messiah</Title>
> </Book>
> <Book>
> <Author idref="RF" />
> <Title>All I Really Need to Know I Learned in Kindergarten</Title>
> </Book>
> <Book>
> <Author idref="RB" />
> <Title>Jonathan Livingston Seagull</Title>
> </Book>
> <Authors>
> <Author id="RB">Richard Bach</Author>
> <Author id="RF">Fulghrum</Author>
> </Authors>
> </Books>
>
> ----------------------------------------------
> external entities
> ----------------------------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE Books [
> <!ENTITY RichardBach SYSTEM "RichardBach.xml">
> <!ENTITY RobertFulghrum SYSTEM "RobertFulghrum.xml">
> ]>
> <?xml-stylesheet type="text/xsl" href="identity.xsl"?>
> <Books>
> <Book>
> &RichardBach;
> <Title>Illusions: The Adventures of a Reluctant Messiah</Title>
> </Book>
> <Book>
> &RobertFulghrum;
> <Title>All I Really Need to Know I Learned in Kindergarten</Title>
> </Book>
> <Book>
> &RichardBach;
> <Title>Jonathan Livingston Seagull</Title>
> </Book>
> </Books>
>
> ----------------------------------------------
> RichardBach.xml
> ----------------------------------------------
> <Author>
> <Name>Richard Bach</Name>
> </Author>
>
> ----------------------------------------------
> RobertFulghrum.xml
> ----------------------------------------------
> <Author>
> <Name>Robert Fulghrum</Name>
> </Author>
>
> _______________________________________________________________________
>
> XML-DEV is a publicly archived, unmoderated list hosted by OASIS
> to support XML implementation and development. To minimize
> spam in the archives, you must subscribe before posting.
>
> [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
> Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
> subscribe: xml-dev-subscribe@lists.xml.org
> List archive: http://lists.xml.org/archives/xml-dev/
> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]