This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Microsoft XML > March 2007 > beginner: small and simpel example from book not working





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author beginner: small and simpel example from book not working
Osewoudt

2007-03-31, 7:20 pm

hello,

i am trying to learn xml.
in the book i use there is an example that you can see below.

the example is not working but i do not understand why.

i get an error that says : ' Verwijzing naar niet nader omschreven item
footer'.

this means roughly (i hope): it points to an not declared item footer.

thanks

henri osewoudt
------------------------- source code -------------------------

<?xml version="1.0" standalone="yes"?>
<family>
<title>my family</title>
<parent role="mother">judy></parent>
<parent role="father">layard</parent>
<child role="daughter">jennifer</child>
<image source="JENN" />
<child role="son">brendan</child>
&footer;
</family>



<!DOCTYPE family [
<!ELEMENT title (#PCDATA)>
<!ELEMENT parent(#PCDATA)>
<!ATTLIST parent role (mother | father) #REQUIRED>
<!ELEMENT child (#PCDATA)>
<!ATTLIST child role (daughter | son) #REQUIRED>
<!NOTATION gif system "image/gif">
<!ENTITY JENN system "http://images.about.com/sites/guidepics/html.gif"
NDATA gif>
<!ELEMENT image empty>
<!ATTLIST image source entity #REQUIRED>
<!ENTITY footer "Brought to you by jennifer">
]>

-------------------------------------------------------------------------


Joe Fawcett

2007-03-31, 7:20 pm

"Osewoudt" <oswwoudt@ufo.org> wrote in message
news:460e7e16$0$30727$ba620dc5@text.nova.planet.nl...
> hello,
>
> i am trying to learn xml.
> in the book i use there is an example that you can see below.
>
> the example is not working but i do not understand why.
>
> i get an error that says : ' Verwijzing naar niet nader omschreven item
> footer'.
>
> this means roughly (i hope): it points to an not declared item footer.
>
> thanks
>
> henri osewoudt
> ------------------------- source code -------------------------
>
> <?xml version="1.0" standalone="yes"?>
> <family>
> <title>my family</title>
> <parent role="mother">judy></parent>
> <parent role="father">layard</parent>
> <child role="daughter">jennifer</child>
> <image source="JENN" />
> <child role="son">brendan</child>
> &footer;
> </family>
>
>
>
> <!DOCTYPE family [
> <!ELEMENT title (#PCDATA)>
> <!ELEMENT parent(#PCDATA)>
> <!ATTLIST parent role (mother | father) #REQUIRED>
> <!ELEMENT child (#PCDATA)>
> <!ATTLIST child role (daughter | son) #REQUIRED>
> <!NOTATION gif system "image/gif">
> <!ENTITY JENN system "http://images.about.com/sites/guidepics/html.gif"
> NDATA gif>
> <!ELEMENT image empty>
> <!ATTLIST image source entity #REQUIRED>
> <!ENTITY footer "Brought to you by jennifer">
> ]>
>
> -------------------------------------------------------------------------
>
>

For the file to be valid then the DTD needs to be associated with it
somehow, otherwise you have an undeclared entity reference, & f o o t e r ;.
How do you tell the XML to use the DTD? If you place the DTD before the XML
content, after the declaration then you will have to address a number of
issues with it such as the NOTATION.

--

Joe Fawcett (MVP - XML)
http://joe.fawcett.name



Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews