[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdenonbeta/kdom/patternist/functions
From: Frans Englich <englich () kde ! org>
Date: 2006-10-31 21:14:10
Message-ID: 1162329250.387069.17036.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 600796 by englich:
Simplify/optimize
M +10 -7 ResolveURIFN.cpp
--- trunk/kdenonbeta/kdom/patternist/functions/ResolveURIFN.cpp #600795:600796
@@ -33,13 +33,16 @@
Item::Ptr ResolveURIFN::evaluateSingleton(const DynamicContext::Ptr &context) const
{
const Item::Ptr rel(m_operands.first()->evaluateSingleton(context));
- const Item::Ptr base(m_operands.last()->evaluateSingleton(context));
- /* TODO: verify base and relative are valid xs:anyURI */
- if(!rel)
+ /* TODO: Verify that base and relative are valid xs:anyURI-values. */
+
+ if(rel)
+ {
+ const Item::Ptr base(m_operands.last()->evaluateSingleton(context));
+ return AnyURI::resolveURI(rel->stringValue(), base->stringValue());
+ }
+ else
return Item::Ptr();
-
- return AnyURI::resolveURI(rel->stringValue(), base->stringValue());
}
Expression::Ptr ResolveURIFN::typeCheck(const StaticContext::Ptr &context,
@@ -53,8 +56,8 @@
m_operands.append(wrapLiteral(context->baseURI()));
else
{
- context->issueStaticError(i18n("No base URI was supplied and the base URI in "
- "the static context is undefined."),
+ context->issueStaticError(i18n("No base URI was supplied and the static base "
+ "URI is undefined."),
ReportContext::FONS0005);
return Expression::Ptr(this);
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic