42xsltNewNsAlias(xsltCompilerCtxtPtr cctxt)
52 "Internal error in xsltNewNsAlias(): Memory allocation failed.\n");
53 cctxt->style->errors++;
60 ret->next = cctxt->nsAliases;
61 cctxt->nsAliases =
ret;
79 xmlNsPtr literalNs =
NULL;
80 xmlNsPtr targetNs =
NULL;
110 stylePrefix = xmlGetNsProp(
node, (
const xmlChar *)
"stylesheet-prefix",
NULL);
111 if (stylePrefix ==
NULL) {
113 "The attribute 'stylesheet-prefix' is missing.\n");
119 literalNs = xmlSearchNs(
node->doc,
node, stylePrefix);
120 if (literalNs ==
NULL) {
122 "Attribute 'stylesheet-prefix': There's no namespace "
123 "declaration in scope for the prefix '%s'.\n",
131 resultPrefix = xmlGetNsProp(
node, (
const xmlChar *)
"result-prefix",
NULL);
132 if (resultPrefix ==
NULL) {
134 "The attribute 'result-prefix' is missing.\n");
140 targetNs = xmlSearchNs(
node->doc,
node, resultPrefix);
142 if (targetNs ==
NULL) {
144 "Attribute 'result-prefix': There's no namespace "
145 "declaration in scope for the prefix '%s'.\n",
190 alias->literalNs = literalNs;
191 alias->targetNs = targetNs;
192 XSLT_CCTXT(
style)->hasNsAliases = 1;
203 stylePrefix = xmlGetNsProp(
node, (
const xmlChar *)
"stylesheet-prefix",
NULL);
204 if (stylePrefix ==
NULL) {
206 "namespace-alias: stylesheet-prefix attribute missing\n");
209 resultPrefix = xmlGetNsProp(
node, (
const xmlChar *)
"result-prefix",
NULL);
210 if (resultPrefix ==
NULL) {
212 "namespace-alias: result-prefix attribute missing\n");
218 if (literalNs ==
NULL) {
219 literalNsName =
NULL;
221 literalNsName = literalNs->href;
223 literalNs = xmlSearchNs(
node->doc,
node, stylePrefix);
225 if ((literalNs ==
NULL) || (literalNs->href ==
NULL)) {
227 "namespace-alias: prefix %s not bound to any namespace\n",
231 literalNsName = literalNs->href;
241 if (targetNs ==
NULL) {
244 targetNsName = targetNs->href;
246 targetNs = xmlSearchNs(
node->doc,
node, resultPrefix);
248 if ((targetNs ==
NULL) || (targetNs->href ==
NULL)) {
250 "namespace-alias: prefix %s not bound to any namespace\n",
254 targetNsName = targetNs->href;
261 if (literalNsName ==
NULL) {
262 if (targetNs !=
NULL) {
274 style->defaultAlias = targetNs->href;
281 "namespace-alias: cannot create hash table\n");
285 literalNsName, (
void *) targetNsName);
290 if (stylePrefix !=
NULL)
292 if (resultPrefix !=
NULL)
324 int prefixOccupied = 0;
327 (
target->type != XML_ELEMENT_NODE))
344 if ((nsPrefix ==
NULL) && ((nsName ==
NULL) || (nsName[0] == 0))) {
362 if ((
ns->href !=
NULL) && (
ns->href[0] != 0)) {
367 "Namespace normalization error: Cannot undeclare "
368 "the default namespace, since the default namespace "
369 "'%s' is already declared on the result element "
385 (
target->parent->type == XML_ELEMENT_NODE))
416 if ((nsPrefix !=
NULL) &&
417 (nsPrefix[0] ==
'x') && (nsPrefix[1] ==
'm') &&
418 (nsPrefix[2] ==
'l') && (nsPrefix[3] == 0))
444 if (prefixOccupied) {
463 (
target->parent->type == XML_ELEMENT_NODE))
476 if (nsPrefix ==
NULL) {
517 goto declare_new_prefix;
548 ns = xmlNewNs(
target, nsName, nsPrefix);
555 ns = xmlNewNs(
target, nsName, nsPrefix);
569 if (nsPrefix ==
NULL) {
578 "Internal error in xsltAcquireResultInScopeNs(): "
579 "Failed to compute a unique ns-prefix for the "
580 "generated element");
623#ifdef XSLT_REFACTORED
666 }
else if (URI ==
NULL)
690 xmlNsPtr
ns, xmlNodePtr
out)
724 if (
cur->type != XML_NAMESPACE_DECL)
734 if (
cur->type != XML_NAMESPACE_DECL)
754#ifdef XSLT_REFACTORED
780 q = xmlNewNs(
node, URI,
cur->prefix);
810 xmlNodePtr
elem, xmlNsPtr
ns)
812 if ((
ns ==
NULL) || (
ns->type != XML_NAMESPACE_DECL))
GLdouble GLdouble GLdouble GLdouble q
xsltStylesheetPtr xsltNextImport(xsltStylesheetPtr cur)
xmlNsPtr xsltCopyNamespace(xsltTransformContextPtr ctxt ATTRIBUTE_UNUSED, xmlNodePtr elem, xmlNsPtr ns)
void xsltFreeNamespaceAliasHashes(xsltStylesheetPtr style)
xmlNsPtr xsltGetPlainNamespace(xsltTransformContextPtr ctxt, xmlNodePtr cur, xmlNsPtr ns, xmlNodePtr out)
void xsltNamespaceAlias(xsltStylesheetPtr style, xmlNodePtr node)
xmlNsPtr xsltGetSpecialNamespace(xsltTransformContextPtr ctxt, xmlNodePtr invocNode, const xmlChar *nsName, const xmlChar *nsPrefix, xmlNodePtr target)
xmlNsPtr xsltCopyNamespaceList(xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNsPtr cur)
xmlNsPtr xsltGetNamespace(xsltTransformContextPtr ctxt, xmlNodePtr cur, xmlNsPtr ns, xmlNodePtr out)
#define UNDEFINED_DEFAULT_NS
void xmlHashFree(xmlHashTablePtr hash, xmlHashDeallocator dealloc)
void * xmlHashLookup(xmlHashTablePtr hash, const xmlChar *key)
int xmlHashAddEntry(xmlHashTablePtr hash, const xmlChar *key, void *payload)
xmlHashTablePtr xmlHashCreate(int size)
xmlHashTablePtr nsAliases
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
XMLPUBFUN int xmlStrEqual(const xmlChar *str1, const xmlChar *str2)
void xsltTransformError(xsltTransformContextPtr ctxt, xsltStylesheetPtr style, xmlNodePtr node, const char *msg,...)