本文整理汇总了C++中DOMElement::getBaseURI方法的典型用法代码示例。如果您正苦于以下问题:C++ DOMElement::getBaseURI方法的具体用法?C++ DOMElement::getBaseURI怎么用?C++ DOMElement::getBaseURI使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DOMElement
的用法示例。
在下文中一共展示了DOMElement::getBaseURI方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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,