Relax_NG_Notes (1) - Relax NG Another Way To Create New...

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

View Full Document Right Arrow Icon
Copyright 2003. Platinum Spider. All Rights Reserved. Relax NG Another Way To Create New Markup Languages
Image of page 1

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

View Full Document Right Arrow Icon
Copyright 2003. Platinum Spider. All Rights Reserved. Online Reading Relax NG Tutorial : http://www.oasis-open.org/committees/relax-ng/tutorial.html
Image of page 2
Copyright 2003. Platinum Spider. All Rights Reserved. Relax NG Getting Started
Image of page 3

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

View Full Document Right Arrow Icon
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>
Image of page 4
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.
Image of page 5

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

View Full Document Right Arrow Icon
Copyright 2003. Platinum Spider. All Rights Reserved. Relax NG Defining the Root Element
Image of page 6
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.
Image of page 7

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

View Full Document Right Arrow Icon
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>
Image of page 8
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
Image of page 9

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

View Full Document Right Arrow Icon
Copyright 2003. Platinum Spider. All Rights Reserved. Relax NG Other Elements
Image of page 10
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>
Image of page 11

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

View Full Document Right Arrow Icon
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.
Image of page 12
Copyright 2003. Platinum Spider. All Rights Reserved.
Image of page 13

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

View Full Document Right Arrow Icon
Image of page 14
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern