Patent ID: 7062708

Claim:
A method for transforming a user-supplied DTD satisfying a first XML grammar into a PDTD satisfying a second XML grammer, the method comprising: converting DTD declarations of alternate content to sequences; converting DTD declarations of optional content to mandatory content; converting DTD declarations of imbedded sequences to subsequences; demoting attribute definitions of DTD elements having attributes to children of the DTD elements having attributes; converting recursions into repetitions; demoting imbedded compound repetitions from element declarations having imbedded compound repetitions; and demoting imbedded leaves from elements having imbedded leaves; wherein the first XML grammar comprises: DTD ::= markupdecl (S markupdecl)* markupdecl ::= elementdecl | AttlistDecl elementdecl ::= ‘<!ELEMENT’ S Name S contentspec S? ‘>’ contentspec ::= ‘EMPTY’ | Mixed | children Mixed ::= ‘(’ S? ‘#PCDATA’ (S? ‘|’ S? Name)* S? ‘)*’ | ‘(’ S? ‘#PCDATA’ S? ‘)’ children ::= (choice | seq) (’?’ | ‘*’ | ‘+’)? choice ::= ‘(’ S? cp (S? ‘|’ S? cp)+ S? ‘)’ cp ::= (Name | choice | seq) (‘?’ | ‘*’ | ‘+’)? seq ::= ‘(’ S? cp (S? ‘,’ S? cp)* S? ‘)’ AttlistDecl ::= ‘<!ATTLIST’ S Name AttDef* S? ‘>’ AttDef ::= S Name S AttType S DefaultDecl AttType ::= StringType | TokenizedType | EnumeratedType StringType ::= ‘CDATA’ TokenizedType ::= ‘ID’ | ‘IDREF’ | ‘IDREFS’ | ‘ENTITY’ | ‘ENTITIES’ | ‘NMTOKEN’ | ‘NMTOKENS’ EnumeratedType ::= NotationType | Enumeration NotationType ::= ‘NOTATION’ S ‘(’ S? Name (S? ‘|’ S? Name)* S? ‘)’ Enumeration ::= ‘(’ S? Nmtoken (S? ‘|’ S? Nmtoken)* S? ‘)’ DefaultDecl ::= ‘#REQUIRED’ | ‘#IMPLIED’ | ((‘#FIXED’ S)? Attvalue).