本文整理汇总了C++中DOMNode::getBaseURI方法的典型用法代码示例。如果您正苦于以下问题:C++ DOMNode::getBaseURI方法的具体用法?C++ DOMNode::getBaseURI怎么用?C++ DOMNode::getBaseURI使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DOMNode
的用法示例。
在下文中一共展示了DOMNode::getBaseURI方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: castToNode
const XMLCh* DOMNodeImpl::getBaseURI() const{
DOMNode *thisNode = castToNode(this);
DOMNode* parent = thisNode->getParentNode();
if (parent)
return parent->getBaseURI();
else
return 0;
}
示例2: isEqualNode
bool DOMNodeImpl::isEqualNode(const DOMNode* arg) const
{
if (!arg)
return false;
if (isSameNode(arg)) {
return true;
}
DOMNode* thisNode = castToNode(this);
if (arg->getNodeType() != thisNode->getNodeType()) {
return false;
}
// the compareString will check null string as well
if (!XMLString::equals(thisNode->getNodeName(), arg->getNodeName())) {
return false;
}
if (!XMLString::equals(thisNode->getLocalName(),arg->getLocalName())) {
return false;
}
if (!XMLString::equals(thisNode->getNamespaceURI(), arg->getNamespaceURI())) {
return false;
}
if (!XMLString::equals(thisNode->getPrefix(), arg->getPrefix())) {
return false;
}
if (!XMLString::equals(thisNode->getNodeValue(), arg->getNodeValue())) {
return false;
}
if (!XMLString::equals(thisNode->getBaseURI(), arg->getBaseURI())) {
return false;
}
return true;
}
示例3: if
//.........这里部分代码省略.........
}
if (href == NULL){
/* this is an unrecoverable error until we have xpointer support -
if there is an xpointer, the current document is assumed
however, there is no xpointer support yet */
XIncludeUtils::reportError(xincludeNode, XMLErrs::XIncludeNoHref,
NULL, parsedDocument->getDocumentURI());
return false;
}
/* set up the accept and accept-language values */
if (accept != NULL){
}
if (parse == NULL){
/* use the default, as specified */
parse = XIncludeUtils::fgXIIncludeParseAttrXMLValue;
}
if (xpointer != NULL){
/* not supported yet */
/* Note that finding an xpointer attr along with parse="text" is a Fatal Error
* - http://www.w3.org/TR/xinclude/#include-location */
XIncludeUtils::reportError(xincludeNode, XMLErrs::XIncludeXPointerNotSupported,
NULL, href);
return false;
}
/* set up the href according to what has gone before */
XIncludeLocation hrefLoc(href);
XIncludeLocation relativeLocation(href);
const XMLCh *includeBase = xincludeNode->getBaseURI();
if (includeBase != NULL){
hrefLoc.prependPath(includeBase);
}
if (getBaseAttrValue(xincludeNode) != NULL){
relativeLocation.prependPath(getBaseAttrValue(xincludeNode));
}
/* Take the relevant action - we need to retrieve the target as a whole before
we can know if it was successful or not, therefore the do* methods do
not modify the parsedDocument. Swapping the results in is left to the
caller (i.e. here) */
DOMText *includedText = NULL;
DOMDocument *includedDoc = NULL;
if (XMLString::equals(parse, XIncludeUtils::fgXIIncludeParseAttrXMLValue)){
/* including a XML element */
includedDoc = doXIncludeXMLFileDOM(hrefLoc.getLocation(), relativeLocation.getLocation(), xincludeNode, parsedDocument, entityResolver);
} else if (XMLString::equals(parse, XIncludeUtils::fgXIIncludeParseAttrTextValue)){
/* including a text value */
includedText = doXIncludeTEXTFileDOM(hrefLoc.getLocation(), relativeLocation.getLocation(), encoding, xincludeNode, parsedDocument, entityResolver);
} else {
/* invalid parse attribute value - fatal error according to the specification */
XIncludeUtils::reportError(xincludeNode, XMLErrs::XIncludeInvalidParseVal,
parse, parsedDocument->getDocumentURI());
return false;
}
RefVectorOf<DOMNode> delayedProcessing(12,false);
if (includedDoc == NULL && includedText == NULL){
/* there was an error - this is now a resource error
let's see if there is a fallback */
XIncludeUtils::reportError(xincludeNode, XMLErrs::XIncludeIncludeFailedResourceError,