Validation Process

Questions about XML that are not covered by the other forums should go here.
Percival Koehl
Posts: 6
Joined: Tue Oct 25, 2005 1:33 am

Validation Process

Post by Percival Koehl » Tue Oct 25, 2005 1:57 am

Hullo everyone. My name is Percival (feel free to call me Percy if you like) and I am an absolute beginner with XML and Oxygen. Actually, my general knowledge of computers is rather weak.

I am having trouble with validation. I have managed to create a DTD with TEI Pizza Chef, but I am not sure what I do in Oxygen to validate my XML document with it. I am sure that this is very simple and right in front of me.

sorin_ristache
Posts: 4144
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache » Tue Oct 25, 2005 11:02 am

Hi Percy,

If you have a valid DTD generated with the TEI Pizza Chef creating and validating XML documents based on the DTD is very simple. Just create a new XML document with the File -> New action also available as the New button on the File toolbar (right-click in the toolbar area to get the list of all toolbars), in the New dialog select the DTD tab, browse to the DTD file saved on disk, leave the default root element, that is TEI.2 and click OK. A new XML document based on the selected DTD will be created. To validate it just press the Validate button on the Document toolbar, also available in the Document -> XML Document menu. Validation errors are displayed in the Errors view displayed in the bottom area. Clicking on an error in the Errors view will highlight the line with the problem in the editor area. If there are no validation errors the Validate action will end with the "Validation successfull" status message. You can find more details in the User Manual:

http://www.oxygenxml.com/doc/ug-oxygen/ ... -documents

http://www.oxygenxml.com/doc/ug-oxygen/ ... -documents

Regards,
Sorin

Percival Koehl
Posts: 6
Joined: Tue Oct 25, 2005 1:33 am

Post by Percival Koehl » Wed Oct 26, 2005 1:32 am

Thank you, Sorin! I was able to begin validating my document with your help. :D

My next question is on this error message:

F A '(' character or element type is required is required in the declaration of
element type "foliohead".

I had defined the element 'foliohead' as:

<!ELEMENT foliohead #PCDATA>

What am I doing wrong?

chiefmechanic
Posts: 5
Joined: Wed Oct 26, 2005 5:02 am

Post by chiefmechanic » Wed Oct 26, 2005 5:08 am

[quote="Percival Koehl"]Thank you, Sorin! I was able to begin validating my document with your help. :D

My next question is on this error message:

F A '(' character or element type is required is required in the declaration of
element type "foliohead".

I had defined the element 'foliohead' as:

<!ELEMENT foliohead #PCDATA>

What am I doing wrong?[/quote]

hello -

looks like you'll just need to enclose the #PCDATA in parentheses:

<!ELEMENT foliohead (#PCDATA)>

good luck, and welcome to xml!

Percival Koehl
Posts: 6
Joined: Tue Oct 25, 2005 1:33 am

Post by Percival Koehl » Wed Oct 26, 2005 5:57 am

chiefmechanic wrote: hello -

looks like you'll just need to enclose the #PCDATA in parentheses:

<!ELEMENT foliohead (#PCDATA)>

good luck, and welcome to xml!
Thank you, Chiefmechanic. I often forget the simplest things!

Right...now this problem truly befuddles me:

'F The markup in the document following the root element must be well-formed.'

The element in question is:

<!ELEMENT excerpt (foliohead?, incipit?, textbody)>

I have no idea why this is...I have closed off the tags.

Percival Koehl
Posts: 6
Joined: Tue Oct 25, 2005 1:33 am

Post by Percival Koehl » Wed Oct 26, 2005 6:33 am

(Pardon me if double posting is disencouraged or against the rules on this forum.)

I think that I ought to explain what I am trying to do...

I am working on an assignment which involves encoding an excerpt from Geoffrey Chaucer's Canterbury Tales. The excerpt includes:

1. A foliohead: {{Folio 2r}}
2. Chaucer's incipit: 'Here bygynneth the Book {/} of the tales of Can|ter|bury'
3. The first twelve lines of the General Prologue.


This is how I have chosen to define elements for the document thus far:

<!ELEMENT excerpt (foliohead, incipit, textbody)>
<!ELEMENT foliohead (#PCDATA)>
<!ELEMENT incipit (#PCDATA)>
<!ELEMENT textbody (couplet+)>
<!ELEMENT couplet (line1, line2)>
<!ELEMENT line1 (#PCDATA)>
<!ELEMENT line2 (#PCDATA)>

This is not all I want to do...I shall probably have to add other elements to note caesurae, unclear text, and other items. I am hoping to put attributes on the line1 and line2 elements to note rhyme value (a, b, c, etc...), and the actual sound of the rhyme. However, I do not want to get too far ahead of myself; I just want to sort out all of my main problems before I begin delving into the dreaded realm of attributes.

[/i]

chiefmechanic
Posts: 5
Joined: Wed Oct 26, 2005 5:02 am

Post by chiefmechanic » Wed Oct 26, 2005 6:39 am

Percival Koehl wrote:
chiefmechanic wrote: hello -

looks like you'll just need to enclose the #PCDATA in parentheses:

<!ELEMENT foliohead (#PCDATA)>

good luck, and welcome to xml!
Thank you, Chiefmechanic. I often forget the simplest things!

Right...now this problem truly befuddles me:

'F The markup in the document following the root element must be well-formed.'

The element in question is:

<!ELEMENT excerpt (foliohead?, incipit?, textbody)>

I have no idea why this is...I have closed off the tags.
hmmm - i think you'll need to include more details. your excerpt element looks ok, but maybe something is happening with the others... however, the error indicates a problem with the well-formedness of the document, so if you've closed all your tags, and your attributes, etc, are all ok, then maybe you've accidentally overlapped elements? for example, the following is not allowed in xml and will cause an error:

<elementA>some content<elementB>some other content</elementA>some more text...</elementB>

Percival Koehl
Posts: 6
Joined: Tue Oct 25, 2005 1:33 am

Post by Percival Koehl » Wed Oct 26, 2005 7:05 am

That is what I thought as well, but I was unable to find any tags which overlapped.

This is what I have got:
<excerpt>

<foliohead>{{Folio 2r}}</foliohead>

<incipit>Here begynneth the Book {/} of the tales of Can|ter|bury</incipit>

<textbody>
<couplet>
<line1>Whan that Aueryll |with| his Shoures soote</line1>
<line2>The droghte of March / hath |per|ced to the roote</line2>
</couplet>
<couplet>
<line1>And bathed euery veyne in swich lycour</line1>
<line2>Of which |ver|tu engendered is the flour</line2>
</couplet>
<couplet>
<line1>Whan zephirus eke / |with| his sweete breeth</line1>
<line2>In{s}pired hath in euery holt/ and heeth</line2>
</couplet>
<couplet>
<line1>The tendre croppes / and the yonge sonne</line1>
<line2>Hath in the Ram / his half cours yronne</line2>
</couplet>
<couplet>
<line1>And sm[a]le foweles / maken melodye</line1>
<line2>That sl[epen] al the nyght / with open Iye</line2>
</couplet>
<couplet>
<line1>So priketh hem nature / in hir corages</line1>
<line2>Than[ne longen] folk/ to goon on pilgrymages</line2>
</couplet>
</textbody>

</excerpt>

sorin_ristache
Posts: 4144
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache » Wed Oct 26, 2005 9:26 am

Hi Percy,

The quoted fragment of your document is well-formed. Is the DTD valid ? If the DTD is valid we need the whole document with the error. If it is large please archive it and send it to support at oxygenxml dot com to tell you what is the error.

Best regards,
Sorin

Percival Koehl
Posts: 6
Joined: Tue Oct 25, 2005 1:33 am

Post by Percival Koehl » Sun Oct 30, 2005 10:17 pm

Hullo. I meant to respond sooner but I had quite a few things to do this week.

Anyhow, I checked the DTD and it is valid, so I shall have to send my files in. The files are small, though.

I did discover that I was supposed to TEI.2 as my document root for my XML document, and I accidentally chose 'authority'. I later looked down the list of document roots, but I could not find TEI.2. Is there any reason for this? How much of a difference would it make if I were to use 'TeiHeader'.

sorin_ristache
Posts: 4144
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache » Mon Oct 31, 2005 12:58 pm

HI Percy,

First make sure you have only one root element in your XML document.
Percival Koehl wrote:I later looked down the list of document roots, but I could not find TEI.2. Is there any reason for this?
I don't understand. Was TEI.2 not present in the list of possible root elements displayed by the New XML document dialog of <oXygen/> ? The TEI Pizza Chef includes TEI.2 in the DTD generated for any base tagset (Prose, Verse, ..., Mixed Base):

Code: Select all

<!ELEMENT TEI.2 
(teiHeader, text) >
and TEI.2 is the first item of the list of the Document root combo box.
Percival Koehl wrote:How much of a difference would it make if I were to use 'TeiHeader'.
If the root is TeiHeader you cannot enter the body of your TEI document because the document would not be valid, only header data like title, address, distributor, publisher, etc. would be allowed.

Regards,
Sorin

Post Reply