Go Back   Velocity Reviews > Newsgroups > XML
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

XML - Well-formed XML question

 
Thread Tools Search this Thread
Old 06-30-2003, 09:48 AM   #1
Default Well-formed XML question


Hi

I'm sure this is a very simple question, but can someone tell me whether the
following is a well-formed XML document (not withstanding the lack of DTD):

<document>Some text <documentcomponent>Component Part</documentcomponent>
some more text </document>

i.e. Embedding a tag within the contents of another tag (a la HTML)?

I'm writing a piece of software which takes a text document and returns
those words within it which it identifies as particular components (date,
etc), for which obviously the above format is potentially most suitable.

Any help appreciated, even if its just pointing at a relevant FAQ.

Regards,



Paul

ps. Remove the .nospam to respond directly.




Paul Flew
  Reply With Quote
Old 06-30-2003, 10:07 AM   #2
Johannes Koch
 
Posts: n/a
Default Re: Well-formed XML question

Paul Flew wrote:
> Hi
>
> I'm sure this is a very simple question, but can someone tell me whether the
> following is a well-formed XML document (not withstanding the lack of DTD):
>
> <document>Some text <documentcomponent>Component Part</documentcomponent>
> some more text </document>


It is.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)

  Reply With Quote
Old 06-30-2003, 01:39 PM   #3
Tad McClellan
 
Posts: n/a
Default Re: Well-formed XML question

Paul Flew <> wrote:

> I'm sure this is a very simple question, but can someone tell me whether the
> following is a well-formed XML document (not withstanding the lack of DTD):
>
><document>Some text <documentcomponent>Component Part</documentcomponent>
> some more text </document>



Yes, it is well-formed.

Why ask thousands of people around the world to spend grey-matter
cycles on a question easily answered with silicon-cycles?

ie. Why not run the document through an XML parser, and see what happens?


> i.e. Embedding a tag within the contents of another tag (a la HTML)?



That is *not* embedding a tag within a tag.

Embedding a tag within a tag is not allowed in XML.

Embedding an element within an element is allowed though.

See the XML FAQ:

http://www.ucc.ie:8080/cocoon/xmlfaq#makeup


--
Tad McClellan SGML consulting
Perl programming
Fort Worth, Texas
  Reply With Quote
Old 07-05-2003, 07:47 AM   #4
Micah Cowan
 
Posts: n/a
Default Re: Well-formed XML question

"Paul Flew" <> writes:

> Hi
>
> I'm sure this is a very simple question, but can someone tell me whether the
> following is a well-formed XML document (not withstanding the lack of DTD):


The lack of DTD doesn't affect its well-formedness, only its "validity".

> <document>Some text <documentcomponent>Component Part</documentcomponent>
> some more text </document>
>
> i.e. Embedding a tag within the contents of another tag (a la HTML)?


This doesn't affect the well-formedness or validity of an XML document
(didn't you know that HTML has an extremely similar XML counterpart,
XHTML?)

-Micah
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump