Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #9557

Re: includes in xml-files?

From Arved Sandstrom <asandstrom3minus1@eastlink.ca>
Newsgroups comp.lang.java.programmer
Subject Re: includes in xml-files?
References <j8vs8h$bah$1@news.m-online.net> <Eq_sq.15572$SW4.9194@newsfe08.iad> <qo19b71rec956hpvg79lks0mtst4euel36@4ax.com>
Message-ID <eL0tq.8245$V07.7551@newsfe22.iad> (permalink)
Organization Public Usenet Newsgroup Access
Date 2011-11-04 22:58 -0300

Show all headers | View raw


On 11-11-04 09:46 PM, Roedy Green wrote:
> On Fri, 04 Nov 2011 20:20:02 -0300, Arved Sandstrom
> <asandstrom3minus1@eastlink.ca> wrote, quoted or indirectly quoted
> someone who said :
> 
>> One standard way of including XML is external parsed entities. See
>> http://www.w3.org/TR/2004/REC-xml-20040204/#sec-external-ent.
> 
> I am amazed you deduced that lawyerly document anything to with
> including text in XML files. 

Well, truth be told, I thought it was pretty obvious. :-) The link you
supplied to that one section of Dave Pawson's site, if you left out the
XSLT stuff, bears that out (Jeni Tennison's answer that you referenced
in particular). It's not so much that I had to investigate the XML spec
to find this, I already knew about it - I thought it was commonplace
knowledge. The entity approach has the advantage of being part of the
XML spec.

Now Magnus mentioned external XML files so that's why I referenced
external parsed entities specifically.

I won't disparage XInclude. It has advantages, notably not needing to
pre-declare external entities in the DTD (which may or may not be an
issue for Magnus). Section 1.2 in http://www.w3.org/TR/xinclude/ should
be read when deciding between the two approaches.

On the subject of XInclude, if the OP wished to try that approach to use
something like

<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
href="inclusion.xml" parse="xml" />

(the parse="xml" is the default actually) then he can modify his
original code with

ftr.setXIncludeAware(true);
ftr.setNamespaceAware(true);

and go to town.

AHS
-- 
You should know the problem before you try to solve it.
Example: When my son was three he cried about a problem with his hand. I
kissed it several times and asked him about the problem. He peed on his
hand.
-- Radia Perlman, inventor of spanning tree protocol

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

includes in xml-files? Magnus Warker <magnux@mailinator.com> - 2011-11-04 06:12 +0100
  Re: includes in xml-files? Roedy Green <see_website@mindprod.com.invalid> - 2011-11-04 15:51 -0700
  Re: includes in xml-files? Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-11-04 20:20 -0300
    Re: includes in xml-files? Roedy Green <see_website@mindprod.com.invalid> - 2011-11-04 17:46 -0700
      Re: includes in xml-files? Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-11-04 22:58 -0300
  Re: includes in xml-files? Arne Vajhøj <arne@vajhoej.dk> - 2011-11-04 20:14 -0400
    Re: includes in xml-files? Arne Vajhøj <arne@vajhoej.dk> - 2011-11-04 21:32 -0400
  Re: includes in xml-files? Jeff Higgins <jeff@invalid.invalid> - 2011-11-04 20:41 -0400
    Re: includes in xml-files? Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-11-04 23:00 -0300
  Re: includes in xml-files? Roedy Green <see_website@mindprod.com.invalid> - 2011-11-04 18:20 -0700

csiph-web