Relax_NG_Notes (1)

Relax_NG_Notes (1) - Copyright 2003. Platinum Spider. All...

Info iconThis preview shows pages 1–14. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Copyright 2003. Platinum Spider. All Rights Reserved. Relax NG Another Way To Create New Markup Languages Copyright 2003. Platinum Spider. All Rights Reserved. Online Reading Relax NG Tutorial : http://www.oasis-open.org/committees/relax-ng/tutorial.html Copyright 2003. Platinum Spider. All Rights Reserved. Relax NG Getting Started Copyright 2003. Platinum Spider. All Rights Reserved. The First Step When creating a Relax-NG Grammar file, you must encase the entire contents of the file in a <grammar> element which is used to specify the version of Relax-NG being used to construct the new markup language. <grammar xmlns=“http://relaxng.org/ns/structure/1.0”> <!-– statements go here --> </grammar> Copyright 2003. Platinum Spider. All Rights Reserved. Starting The Grammar Next, you must nest a <start> element within the <grammar> element. <grammar xmlns=“http://relaxng.org/ns/structure/1.0”> <start> <!-– statements go here --> </start> </grammar> The <start> element informs the validator where validation must start and encompases the main body of the grammar. Copyright 2003. Platinum Spider. All Rights Reserved. Relax NG Defining the Root Element Copyright 2003. Platinum Spider. All Rights Reserved. Defining the Root Element Within the <start> element, the Root Element of the Grammar is defined. <grammar xmlns=“http://relaxng.org/ns/structure/1.0”> <start> <element ...> <!-– statements go here --> </element> </start> </grammar> Elements in Relax-NG are defined using <element> elements. Copyright 2003. Platinum Spider. All Rights Reserved. Defining an Element To name the root element for a RELAX NG document, you must include the name attribute within the <element> element. <grammar xmlns=“http://relaxng.org/ns/structure/1.0”> <start> < element name=“element_name” > <!-– statements go here --> </element> </start> </grammar> Copyright 2003. Platinum Spider. All Rights Reserved. An Example <grammar xmlns=“http://relaxng.org/ns/structure/1.0”> <start> < element name=“card-catalog”> <!-– statements go here --> </element> </start> </grammar> <?xml version=“1.0” encoding=“UTF-8”?> <card-catalog> <!–- statements go here --> </card-catalog> Relax NG File XML File Copyright 2003. Platinum Spider. All Rights Reserved. Relax NG Other Elements Copyright 2003. Platinum Spider. All Rights Reserved. Defining Text Content To define an element so that it contains text , which is the equivalent of #PCDATA , you must include a empty <text/> element within the element itself. < element name=“element_name”> <text/> </element> Copyright 2003. Platinum Spider. All Rights Reserved. An Example < element name=“card-catalog”> <text/> </element> <?xml version=“1.0” encoding=“UTF-8”?> <card-catalog> Catalog of Books </card-catalog> Relax NG File XML File With the use of <text/> , leading and trailing whitespace may be included as content. Copyright 2003. Platinum Spider. All Platinum Spider....
View Full Document

This note was uploaded on 12/11/2011 for the course CIS 92 taught by Professor Taylor-harper during the Fall '11 term at DeAnza College.

Page1 / 157

Relax_NG_Notes (1) - Copyright 2003. Platinum Spider. All...

This preview shows document pages 1 - 14. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online