text stringlengths 81 112k |
|---|
Create an XML Schemas validation context based on the given
schema.
def schemaNewValidCtxt(self):
"""Create an XML Schemas validation context based on the given
schema. """
ret = libxml2mod.xmlSchemaNewValidCtxt(self._o)
if ret is None:raise treeError('xmlSchemaNewValidCtx... |
Use W3C XSD schema context to validate the document as it
is processed. Activation is only possible before the first
Read(). If @ctxt is None, then XML Schema validation is
deactivated.
def SchemaValidateCtxt(self, reader, options):
"""Use W3C XSD schema context to validate the d... |
Sets the options to be used during the validation.
def schemaSetValidOptions(self, options):
"""Sets the options to be used during the validation. """
ret = libxml2mod.xmlSchemaSetValidOptions(self._o, options)
return ret |
allow access to the parser context of the schema validation
context
def schemaValidCtxtGetParserCtxt(self):
"""allow access to the parser context of the schema validation
context """
ret = libxml2mod.xmlSchemaValidCtxtGetParserCtxt(self._o)
if ret is None:raise parserError... |
Validate a document tree in memory.
def schemaValidateDoc(self, doc):
"""Validate a document tree in memory. """
if doc is None: doc__o = None
else: doc__o = doc._o
ret = libxml2mod.xmlSchemaValidateDoc(self._o, doc__o)
return ret |
Do a schemas validation of the given resource, it will use
the SAX streamable validation internally.
def schemaValidateFile(self, filename, options):
"""Do a schemas validation of the given resource, it will use
the SAX streamable validation internally. """
ret = libxml2mod.xmlSch... |
Validate a branch of a tree, starting with the given @elem.
def schemaValidateOneElement(self, elem):
"""Validate a branch of a tree, starting with the given @elem. """
if elem is None: elem__o = None
else: elem__o = elem._o
ret = libxml2mod.xmlSchemaValidateOneElement(self._o, elem__o)... |
Hacking interface allowing to get the xmlDocPtr
correponding to the current document being accessed by the
xmlTextReader. NOTE: as a result of this call, the reader
will not destroy the associated XML document and calling
xmlFreeDoc() on the result is needed once the reader
... |
Hacking interface allowing to get the xmlNodePtr
correponding to the current node being accessed by the
xmlTextReader. This is dangerous because the underlying
node may be destroyed on the next Reads.
def CurrentNode(self):
"""Hacking interface allowing to get the xmlNodePtr
... |
Reads the contents of the current node and the full
subtree. It then makes the subtree available until the next
xmlTextReaderRead() call
def Expand(self):
"""Reads the contents of the current node and the full
subtree. It then makes the subtree available until the next
... |
Provides the value of the attribute with the specified
qualified name.
def GetAttribute(self, name):
"""Provides the value of the attribute with the specified
qualified name. """
ret = libxml2mod.xmlTextReaderGetAttribute(self._o, name)
return ret |
Provides the value of the attribute with the specified
index relative to the containing element.
def GetAttributeNo(self, no):
"""Provides the value of the attribute with the specified
index relative to the containing element. """
ret = libxml2mod.xmlTextReaderGetAttributeNo(self.... |
Provides the value of the specified attribute
def GetAttributeNs(self, localName, namespaceURI):
"""Provides the value of the specified attribute """
ret = libxml2mod.xmlTextReaderGetAttributeNs(self._o, localName, namespaceURI)
return ret |
Read the parser internal property.
def GetParserProp(self, prop):
"""Read the parser internal property. """
ret = libxml2mod.xmlTextReaderGetParserProp(self._o, prop)
return ret |
Method to get the remainder of the buffered XML. this
method stops the parser, set its state to End Of File and
return the input stream with what is left that the parser
did not use. The implementation is not good, the parser
certainly procgressed past what's left in reader->inp... |
Resolves a namespace prefix in the scope of the current
element.
def LookupNamespace(self, prefix):
"""Resolves a namespace prefix in the scope of the current
element. """
ret = libxml2mod.xmlTextReaderLookupNamespace(self._o, prefix)
return ret |
Moves the position of the current instance to the attribute
with the specified qualified name.
def MoveToAttribute(self, name):
"""Moves the position of the current instance to the attribute
with the specified qualified name. """
ret = libxml2mod.xmlTextReaderMoveToAttribute(self.... |
Moves the position of the current instance to the attribute
with the specified index relative to the containing element.
def MoveToAttributeNo(self, no):
"""Moves the position of the current instance to the attribute
with the specified index relative to the containing element. """
r... |
Moves the position of the current instance to the attribute
with the specified local name and namespace URI.
def MoveToAttributeNs(self, localName, namespaceURI):
"""Moves the position of the current instance to the attribute
with the specified local name and namespace URI. """
re... |
Setup an xmltextReader to parse an XML in-memory document.
The parsing flags @options are a combination of
xmlParserOption. This reuses the existing @reader
xmlTextReader.
def NewDoc(self, cur, URL, encoding, options):
"""Setup an xmltextReader to parse an XML in-memory document.... |
Setup an xmltextReader to parse an XML from a file
descriptor. NOTE that the file descriptor will not be
closed when the reader is closed or reset. The parsing
flags @options are a combination of xmlParserOption. This
reuses the existing @reader xmlTextReader.
def NewFd(self, f... |
parse an XML file from the filesystem or the network. The
parsing flags @options are a combination of
xmlParserOption. This reuses the existing @reader
xmlTextReader.
def NewFile(self, filename, encoding, options):
"""parse an XML file from the filesystem or the network. The
... |
Setup an xmltextReader to parse an XML in-memory document.
The parsing flags @options are a combination of
xmlParserOption. This reuses the existing @reader
xmlTextReader.
def NewMemory(self, buffer, size, URL, encoding, options):
"""Setup an xmltextReader to parse an XML in-memo... |
Setup an xmltextReader to parse a preparsed XML document.
This reuses the existing @reader xmlTextReader.
def NewWalker(self, doc):
"""Setup an xmltextReader to parse a preparsed XML document.
This reuses the existing @reader xmlTextReader. """
if doc is None: doc__o = None
... |
This tells the XML Reader to preserve the current node. The
caller must also use xmlTextReaderCurrentDoc() to keep an
handle on the resulting document once parsing has finished
def Preserve(self):
"""This tells the XML Reader to preserve the current node. The
caller must also use... |
Use RelaxNG to validate the document as it is processed.
Activation is only possible before the first Read(). if
@schema is None, then RelaxNG validation is desactivated. @
The @schema should not be freed until the reader is
deallocated or its use has been deactivated.
def Rela... |
Use RelaxNG schema to validate the document as it is
processed. Activation is only possible before the first
Read(). If @rng is None, then RelaxNG schema validation is
deactivated.
def RelaxNGValidate(self, rng):
"""Use RelaxNG schema to validate the document as it is
p... |
Use RelaxNG schema context to validate the document as it
is processed. Activation is only possible before the first
Read(). If @ctxt is None, then RelaxNG schema validation is
deactivated.
def RelaxNGValidateCtxt(self, ctxt, options):
"""Use RelaxNG schema context to validate th... |
Use W3C XSD schema to validate the document as it is
processed. Activation is only possible before the first
Read(). If @xsd is None, then XML Schema validation is
deactivated.
def SchemaValidate(self, xsd):
"""Use W3C XSD schema to validate the document as it is
proces... |
Use W3C XSD schema context to validate the document as it
is processed. Activation is only possible before the first
Read(). If @ctxt is None, then XML Schema validation is
deactivated.
def SchemaValidateCtxt(self, ctxt, options):
"""Use W3C XSD schema context to validate the doc... |
Change the parser processing behaviour by changing some of
its internal properties. Note that some properties can only
be changed before any read has been done.
def SetParserProp(self, prop, value):
"""Change the parser processing behaviour by changing some of
its internal proper... |
Use XSD Schema to validate the document as it is processed.
Activation is only possible before the first Read(). if
@schema is None, then Schema validation is desactivated. @
The @schema should not be freed until the reader is
deallocated or its use has been deactivated.
def Se... |
Setup an XML reader with new options
def Setup(self, input, URL, encoding, options):
"""Setup an XML reader with new options """
if input is None: input__o = None
else: input__o = input._o
ret = libxml2mod.xmlTextReaderSetup(self._o, input__o, URL, encoding, options)
return ret |
Get an interned string from the reader, allows for example
to speedup string name comparisons
def String(self, str):
"""Get an interned string from the reader, allows for example
to speedup string name comparisons """
ret = libxml2mod.xmlTextReaderConstString(self._o, str)
... |
Parse an URI reference string based on RFC 3986 and fills
in the appropriate fields of the @uri structure
URI-reference = URI / relative-ref
def parseURIReference(self, str):
"""Parse an URI reference string based on RFC 3986 and fills
in the appropriate fields of the @uri struct... |
Does the validation related extra step of the normalization
of attribute values: If the declared value is not CDATA,
then the XML processor must further process the normalized
attribute value by discarding any leading and trailing
space (#x20) characters, and by replacing sequen... |
Try to validate the document instance basically it does
the all the checks described by the XML Rec i.e. validates
the internal and external subset (if present) and validate
the document tree.
def validateDocument(self, doc):
"""Try to validate the document instance basically i... |
Does the final step for the document validation once all
the incremental validation steps have been completed
basically it does the following checks described by the XML
Rec Check all the IDREF/IDREFS attributes definition for
validity
def validateDocumentFinal(self, doc):
... |
Try to validate the document against the dtd instance
Basically it does check all the definitions in the DtD.
Note the the internal subset (if present) is de-coupled
(i.e. not used), which could give problems if ID or IDREF
is present.
def validateDtd(self, doc, dtd):
"... |
Does the final step for the dtds validation once all the
subsets have been parsed basically it does the following
checks described by the XML Rec - check that ENTITY and
ENTITIES type attributes default or possible values matches
one of the defined entities. - check that NOTATIO... |
Try to validate the subtree under an element
def validateElement(self, doc, elem):
"""Try to validate the subtree under an element """
if doc is None: doc__o = None
else: doc__o = doc._o
if elem is None: elem__o = None
else: elem__o = elem._o
ret = libxml2mod.xmlValidate... |
Validate that the given name match a notation declaration.
- [ VC: Notation Declared ]
def validateNotationUse(self, doc, notationName):
"""Validate that the given name match a notation declaration.
- [ VC: Notation Declared ] """
if doc is None: doc__o = None
else: doc__o... |
Try to validate a single attribute for an element basically
it does the following checks as described by the XML-1.0
recommendation: - [ VC: Attribute Value Type ] - [ VC:
Fixed Attribute Default ] - [ VC: Entity Name ] - [ VC:
Name Token ] - [ VC: ID ] - [ VC: IDREF ] - [ VC: En... |
Try to validate a single element and it's attributes,
basically it does the following checks as described by the
XML-1.0 recommendation: - [ VC: Element Valid ] - [ VC:
Required Attribute ] Then call xmlValidateOneAttribute()
for each attribute present. The ID/IDREF checkings ar... |
Try to validate a single namespace declaration for an
element basically it does the following checks as described
by the XML-1.0 recommendation: - [ VC: Attribute Value Type
] - [ VC: Fixed Attribute Default ] - [ VC: Entity Name ] -
[ VC: Name Token ] - [ VC: ID ] - [ VC: IDREF ... |
Pop the element end from the validation stack.
def validatePopElement(self, doc, elem, qname):
"""Pop the element end from the validation stack. """
if doc is None: doc__o = None
else: doc__o = doc._o
if elem is None: elem__o = None
else: elem__o = elem._o
ret = libxml2m... |
check the CData parsed for validation in the current stack
def validatePushCData(self, data, len):
"""check the CData parsed for validation in the current stack """
ret = libxml2mod.xmlValidatePushCData(self._o, data, len)
return ret |
Push a new element start on the validation stack.
def validatePushElement(self, doc, elem, qname):
"""Push a new element start on the validation stack. """
if doc is None: doc__o = None
else: doc__o = doc._o
if elem is None: elem__o = None
else: elem__o = elem._o
ret = l... |
Try to validate a the root element basically it does the
following check as described by the XML-1.0 recommendation:
- [ VC: Root Element Type ] it doesn't try to recurse or
apply other check to the element
def validateRoot(self, doc):
"""Try to validate a the root element basica... |
Get the doc from an xpathContext
def contextDoc(self):
"""Get the doc from an xpathContext """
ret = libxml2mod.xmlXPathGetContextDoc(self._o)
if ret is None:raise xpathError('xmlXPathGetContextDoc() failed')
__tmp = xmlDoc(_obj=ret)
return __tmp |
Get the current node from an xpathContext
def contextNode(self):
"""Get the current node from an xpathContext """
ret = libxml2mod.xmlXPathGetContextNode(self._o)
if ret is None:raise xpathError('xmlXPathGetContextNode() failed')
__tmp = xmlNode(_obj=ret)
return __tmp |
Set the doc of an xpathContext
def setContextDoc(self, doc):
"""Set the doc of an xpathContext """
if doc is None: doc__o = None
else: doc__o = doc._o
libxml2mod.xmlXPathSetContextDoc(self._o, doc__o) |
Set the current node of an xpathContext
def setContextNode(self, node):
"""Set the current node of an xpathContext """
if node is None: node__o = None
else: node__o = node._o
libxml2mod.xmlXPathSetContextNode(self._o, node__o) |
Register a Python written function to the XPath interpreter
def registerXPathFunction(self, name, ns_uri, f):
"""Register a Python written function to the XPath interpreter """
ret = libxml2mod.xmlRegisterXPathFunction(self._o, name, ns_uri, f)
return ret |
Register a variable with the XPath context
def xpathRegisterVariable(self, name, ns_uri, value):
"""Register a variable with the XPath context """
ret = libxml2mod.xmlXPathRegisterVariable(self._o, name, ns_uri, value)
return ret |
Creates/frees an object cache on the XPath context. If
activates XPath objects (xmlXPathObject) will be cached
internally to be reused. @options: 0: This will set the
XPath object caching: @value: This will set the maximum
number of XPath objects to be cached per slot There are 5... |
Evaluate the XPath Location Path in the given context.
def xpathEval(self, str):
"""Evaluate the XPath Location Path in the given context. """
ret = libxml2mod.xmlXPathEval(str, self._o)
if ret is None:raise xpathError('xmlXPathEval() failed')
return xpathObjectRet(ret) |
Evaluate the XPath expression in the given context.
def xpathEvalExpression(self, str):
"""Evaluate the XPath expression in the given context. """
ret = libxml2mod.xmlXPathEvalExpression(str, self._o)
if ret is None:raise xpathError('xmlXPathEvalExpression() failed')
return xpathObjectR... |
Create a new xmlXPathParserContext
def xpathNewParserContext(self, str):
"""Create a new xmlXPathParserContext """
ret = libxml2mod.xmlXPathNewParserContext(str, self._o)
if ret is None:raise xpathError('xmlXPathNewParserContext() failed')
__tmp = xpathParserContext(_obj=ret)
re... |
Search in the namespace declaration array of the context
for the given namespace name associated to the given prefix
def xpathNsLookup(self, prefix):
"""Search in the namespace declaration array of the context
for the given namespace name associated to the given prefix """
ret = l... |
Register a new namespace. If @ns_uri is None it unregisters
the namespace
def xpathRegisterNs(self, prefix, ns_uri):
"""Register a new namespace. If @ns_uri is None it unregisters
the namespace """
ret = libxml2mod.xmlXPathRegisterNs(self._o, prefix, ns_uri)
return ret |
Search in the Variable array of the context for the given
variable value.
def xpathVariableLookup(self, name):
"""Search in the Variable array of the context for the given
variable value. """
ret = libxml2mod.xmlXPathVariableLookup(self._o, name)
if ret is None:raise xpath... |
Search in the Variable array of the context for the given
variable value.
def xpathVariableLookupNS(self, name, ns_uri):
"""Search in the Variable array of the context for the given
variable value. """
ret = libxml2mod.xmlXPathVariableLookupNS(self._o, name, ns_uri)
if ret... |
Evaluate the XPath Location Path in the given context.
def xpointerEval(self, str):
"""Evaluate the XPath Location Path in the given context. """
ret = libxml2mod.xmlXPtrEval(str, self._o)
if ret is None:raise treeError('xmlXPtrEval() failed')
return xpathObjectRet(ret) |
Get the xpathContext from an xpathParserContext
def context(self):
"""Get the xpathContext from an xpathParserContext """
ret = libxml2mod.xmlXPathParserGetContext(self._o)
if ret is None:raise xpathError('xmlXPathParserGetContext() failed')
__tmp = xpathContext(_obj=ret)
return... |
Implement the compare operation on XPath objects: @arg1 <
@arg2 (1, 1, ... @arg1 <= @arg2 (1, 0, ... @arg1 >
@arg2 (0, 1, ... @arg1 >= @arg2 (0, 0, ... When
neither object to be compared is a node-set and the
operator is <=, <, >=, >, then the objects are compared by
... |
Traversal function for the "ancestor" direction the
ancestor axis contains the ancestors of the context node;
the ancestors of the context node consist of the parent of
context node and the parent's parent and so on; the nodes
are ordered in reverse document order; thus the paren... |
Traversal function for the "ancestor-or-self" direction he
ancestor-or-self axis contains the context node and
ancestors of the context node in reverse document order;
thus the context node is the first node on the axis, and
the context node's parent the second; parent here is
... |
Traversal function for the "attribute" direction TODO:
support DTD inherited default attributes
def xpathNextAttribute(self, cur):
"""Traversal function for the "attribute" direction TODO:
support DTD inherited default attributes """
if cur is None: cur__o = None
else: cur... |
Traversal function for the "child" direction The child axis
contains the children of the context node in document order.
def xpathNextChild(self, cur):
"""Traversal function for the "child" direction The child axis
contains the children of the context node in document order. """
if ... |
Traversal function for the "descendant" direction the
descendant axis contains the descendants of the context
node in document order; a descendant is a child or a child
of a child and so on.
def xpathNextDescendant(self, cur):
"""Traversal function for the "descendant" direction ... |
Traversal function for the "descendant-or-self" direction
the descendant-or-self axis contains the context node and
the descendants of the context node in document order; thus
the context node is the first node on the axis, and the
first child of the context node is the second no... |
Traversal function for the "following" direction The
following axis contains all nodes in the same document as
the context node that are after the context node in
document order, excluding any descendants and excluding
attribute nodes and namespace nodes; the nodes are ordered
... |
Traversal function for the "following-sibling" direction
The following-sibling axis contains the following siblings
of the context node in document order.
def xpathNextFollowingSibling(self, cur):
"""Traversal function for the "following-sibling" direction
The following-sibling a... |
Traversal function for the "namespace" direction the
namespace axis contains the namespace nodes of the context
node; the order of nodes on this axis is
implementation-defined; the axis will be empty unless the
context node is an element We keep the XML namespace node
... |
Traversal function for the "parent" direction The parent
axis contains the parent of the context node, if there is
one.
def xpathNextParent(self, cur):
"""Traversal function for the "parent" direction The parent
axis contains the parent of the context node, if there is
... |
Traversal function for the "preceding" direction the
preceding axis contains all nodes in the same document as
the context node that are before the context node in
document order, excluding any ancestors and excluding
attribute nodes and namespace nodes; the nodes are ordered
... |
Traversal function for the "preceding-sibling" direction
The preceding-sibling axis contains the preceding siblings
of the context node in reverse document order; the first
preceding sibling is first on the axis; the sibling
preceding that node is the second on the axis and so o... |
Traversal function for the "self" direction The self axis
contains just the context node itself
def xpathNextSelf(self, cur):
"""Traversal function for the "self" direction The self axis
contains just the context node itself """
if cur is None: cur__o = None
else: cur__o =... |
Formats an error message.
def xpatherror(self, file, line, no):
"""Formats an error message. """
libxml2mod.xmlXPatherror(self._o, file, line, no) |
Returns a structured description of the model, including (where relevant)
the schema of the training data, description of the training data,
training statistics, and model hyperparameters.
Returns
-------
sections : list (of list of tuples)
A list of summary sections... |
Return a classification, for each example in the ``dataset``, using the
trained logistic regression model. The output SFrame contains predictions
as both class labels (0 or 1) as well as probabilities that the predicted
value is the associated label.
Parameters
----------
... |
Appends the suffix appropriate to 'type/property-set' combination
to the specified name and returns the result.
def add_prefix_and_suffix(specified_name, type, property_set):
"""Appends the suffix appropriate to 'type/property-set' combination
to the specified name and returns the result."""
property_... |
Traverses the dependency graph of 'target' and return all targets that will
be created before this one is created. If root of some dependency graph is
found during traversal, it's either included or not, dependencing of the
value of 'include_roots'. In either case, sources of root are not traver... |
Takes an 'action' instances and creates new instance of it
and all produced target. The rule-name and properties are set
to 'new-rule-name' and 'new-properties', if those are specified.
Returns the cloned action.
def clone_action (action, new_project, new_action_name, new_properties):
"""Takes an 'acti... |
Registers a new virtual target. Checks if there's already registered target, with the same
name, type, project and subvariant properties, and also with the same sources
and equal action. If such target is found it is retured and 'target' is not registered.
Otherwise, 'target' is regi... |
Creates a virtual target with appropriate name and type from 'file'.
If a target with that name in that project was already created, returns that already
created target.
TODO: more correct way would be to compute path to the file, based on name and source location
for the... |
Appends the suffix appropriate to 'type/property_set' combination
to the specified name and returns the result.
def add_suffix (self, specified_name, file_type, prop_set):
""" Appends the suffix appropriate to 'type/property_set' combination
to the specified name and returns the result.... |
Adds additional instances of 'VirtualTarget' that this
one depends on.
def depends (self, d):
""" Adds additional instances of 'VirtualTarget' that this
one depends on.
"""
self.dependencies_ = unique (self.dependencies_ + d).sort () |
Generates all the actual targets and sets up build actions for
this target.
If 'scanner' is specified, creates an additional target
with the same location as actual target, which will depend on the
actual target and be associated with 'scanner'. That additional
... |
Sets the path. When generating target name, it will override any path
computation from properties.
def set_path (self, path):
""" Sets the path. When generating target name, it will override any path
computation from properties.
"""
assert isinstance(path, basestring)
... |
Sets/gets the 'root' flag. Target is root is it directly correspods to some
variant of a main target.
def root (self, set = None):
""" Sets/gets the 'root' flag. Target is root is it directly correspods to some
variant of a main target.
"""
assert isinstance(set, (int, b... |
Gets or sets the subvariant which created this target. Subvariant
is set when target is brought into existance, and is never changed
after that. In particual, if target is shared by subvariant, only
the first is stored.
s: If specified, specified the value to set,
which ... |
Helper to 'actual_name', above. Compute unique prefix used to distinguish
this target from other targets with the same name which create different
file.
def grist (self):
"""Helper to 'actual_name', above. Compute unique prefix used to distinguish
this target from other targ... |
Given the target name specified in constructor, returns the
name which should be really used, by looking at the <tag> properties.
The tag properties come in two flavour:
- <tag>value,
- <tag>@rule-name
In the first case, value is just added to name
In the second case,... |
Returns the directory for this target.
def path (self):
""" Returns the directory for this target.
"""
if not self.path_:
if self.action_:
p = self.action_.properties ()
(target_path, relative_to_build_dir) = p.target_path ()
if relat... |
Generates actual build instructions.
def actualize (self):
""" Generates actual build instructions.
"""
if self.actualized_:
return
self.actualized_ = True
ps = self.properties ()
properties = self.adjust_properties (ps)
actual_targets = []
... |
Helper for 'actualize_sources'.
For each passed source, actualizes it with the appropriate scanner.
Returns the actualized virtual targets.
def actualize_source_type (self, sources, prop_set):
""" Helper for 'actualize_sources'.
For each passed source, actualizes it with the... |
Creates actual jam targets for sources. Initializes two member
variables:
'self.actual_sources_' -- sources which are passed to updating action
'self.dependency_only_sources_' -- sources which are made dependencies, but
are not used otherwise.
New values will... |
Returns all targets referenced by this subvariant,
either directly or indirectly, and either as sources,
or as dependency properties. Targets referred with
dependency property are returned a properties, not targets.
def all_referenced_targets(self, result):
"""Returns all targets refere... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.