Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / September 2006

Tip: Looking for answers? Try searching our database.

whats is PCDATA ?

Thread view: 
gk - 28 Sep 2006 12:14 GMT
i have a DTD file

<?xml encoding="UTF-8"?>
<!ELEMENT organization (organizationinfo*)>
<!ELEMENT stockinfo (name, address,services)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT address (#PCDATA)>

whats this PCDATA above ?

what it means ? i dont understand it.

please explain with an example .
Gordon Beaton - 28 Sep 2006 12:19 GMT
> i have a DTD file
[...]
> what it means ? i dont understand it.

c.l.j.p is about Java programming. Why don't you ask your XML question
in an XML group?

/gordon

Signature

[ don't email me support questions or followups ]
g o r d o n  +  n e w s  @  b a l d e r 1 3 . s e

Tor Iver Wilhelmsen - 28 Sep 2006 17:52 GMT
> whats this PCDATA above ?

It means the content is parsed character data, i.e. it should expand
entities etc.
gk - 29 Sep 2006 08:43 GMT
> > whats this PCDATA above ?
>
> It means the content is parsed character data, i.e. it should expand
> entities etc.

ok , so you mean PCDATA = parsed character data  ?
whats this parsed character data ?
Andrew Thompson - 29 Sep 2006 08:54 GMT
> > > whats this PCDATA above ?
> >
[quoted text clipped - 3 lines]
> ok , so you mean PCDATA = parsed character data  ?
>  whats this parsed character data ?

Hungry for knowledge?
..Where is the group's 'spoon'?

Andrew T.
Dag Sunde - 29 Sep 2006 09:33 GMT
>>> whats this PCDATA above ?
>>
[quoted text clipped - 3 lines]
> ok , so you mean PCDATA = parsed character data  ?
> whats this parsed character data ?

He just said...:
"...it should expand entities etc..."

It will be parsed by the xml parser so &lt; and other entities will
be expanded. As opposed to CDATA, that will be left alone, unparsed
by the parser.

Signature

Dag.

gk - 29 Sep 2006 09:59 GMT
> >>> whats this PCDATA above ?
> >>
[quoted text clipped - 10 lines]
> be expanded. As opposed to CDATA, that will be left alone, unparsed
> by the parser.

ok i guess so it means  in the declaration below
<!ELEMENT address (#PCDATA)>

see , the parser picks up DTD file to check whether the XML conforms
the DTD or not  that is it checks for valid XML.

i see some of them dont have PCDATA declared  in the  DTD file  except
the address element.

what happened if i did not decalre PCDATA above ? ........why only the
address element has got PCDATA ?

its confusing.

i dont understand what PCDATA is doing here .

anybody please give an example .

thanks
Dag Sunde - 29 Sep 2006 11:01 GMT
>>>>> whats this PCDATA above ?
>>>>
[quoted text clipped - 13 lines]
> ok i guess so it means  in the declaration below
> <!ELEMENT address (#PCDATA)>

> see , the parser picks up DTD file to check whether the XML conforms
> the DTD or not  that is it checks for valid XML.

This declares that <address> is a valid tag in any xml document using
this DTD, and that the *content* of that <address></address> tag contains
character data that must be parsed by the parser reading the xml-document.

> i see some of them dont have PCDATA declared  in the  DTD file  except
> the address element.
>
> what happened if i did not decalre PCDATA above ? ........why only the
> address element has got PCDATA ?

Those two questions must be directed to the author of the DTD.
We can't possibly know what he was thinking about.

> its confusing.
>
> i dont understand what PCDATA is doing here .

See above...

Signature

Dag.

gk - 29 Sep 2006 11:25 GMT
> >>>>> whats this PCDATA above ?
> >>>>
[quoted text clipped - 20 lines]
> this DTD, and that the *content* of that <address></address> tag contains
> character data that must be parsed by the parser reading the xml-document.

say i have  <address>new york city </address>  in XML

you told   "MUST"

so  while parser will use this DTD , it will MUST parse  the data
contained in  <address> tag.........but for what ?  whats the benefit
if we parse or if we dont parse .

so,
it seems if we put PCDATA then parser will parse the content  between
the tags.
if we DONT put  PCDATA then parser will NOT parse the content  between
the tags.

what  the hell on this earth will  happen if the parser parse or does
not parse.

suppose, the parser really forced to parse  the XML because of this
PCDATA constraint .....so what ? it just parsed  does it  help us any
way ?

still not able to catch the greatness of this PCDATA .

> > i see some of them dont have PCDATA declared  in the  DTD file  except
> > the address element.
[quoted text clipped - 10 lines]
>
> See above...
Dag Sunde - 29 Sep 2006 12:24 GMT
<snipped/>

>> This declares that <address> is a valid tag in any xml document using
>> this DTD, and that the *content* of that <address></address> tag
[quoted text clipped - 23 lines]
>
> still not able to catch the greatness of this PCDATA .

What about if the content contained '<', '&', 'Ø' ...?

and what about if you used entities like &lt; &amp; and &Oslash;
instead?

Try, experiment...

Signature

Dag.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.