dk.brics.relaxng.converter
Class RestrRelaxNG2XMLGraph

java.lang.Object
  extended by dk.brics.relaxng.converter.RestrRelaxNG2XMLGraph

public class RestrRelaxNG2XMLGraph
extends Object

Production of XML graph fragment from Restricted RELAX NG schema.


Constructor Summary
RestrRelaxNG2XMLGraph(XMLGraph xg, DatatypeLibrary libs)
          Constructs a new converter.
 
Method Summary
 XMLGraph convert(Grammar g)
          Converts the given schema into a new XML graph.
 XMLGraphFragment extend(Grammar g)
          Extends the XML graph with a fragment corresponding to the given schema.
 Map<String,SequenceNode> getDefineNodes()
          Returns map from define names to XML graph nodes from the last conversion.
 void useSurroundingChoiceNodes(boolean b)
          Enables/disables use of extra ChoiceNodes around each ElementNode and AttributeNode and above each TextNode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RestrRelaxNG2XMLGraph

public RestrRelaxNG2XMLGraph(XMLGraph xg,
                             DatatypeLibrary libs)
Constructs a new converter.

Parameters:
xg - XML graph where fragments are to be added (null if using convert)
libs - datatype converter
Method Detail

convert

public XMLGraph convert(Grammar g)
                 throws ConverterException
Converts the given schema into a new XML graph.

Parameters:
g - schema
Returns:
XML graph
Throws:
ConverterException - if unable to convert schema

extend

public XMLGraphFragment extend(Grammar g)
                        throws ConverterException
Extends the XML graph with a fragment corresponding to the given schema.

Parameters:
g - schema
Returns:
XML graph fragment encapsulation, null if empty
Throws:
ConverterException - if unable to convert schema

getDefineNodes

public Map<String,SequenceNode> getDefineNodes()
Returns map from define names to XML graph nodes from the last conversion.

Returns:
map

useSurroundingChoiceNodes

public void useSurroundingChoiceNodes(boolean b)
Enables/disables use of extra ChoiceNodes around each ElementNode and AttributeNode and above each TextNode. Default: disabled

Parameters:
b - enable if true, disable if false


Copyright © 2005-2010 Anders Møller.