+Sun Jan 12 23:56:18 CET 2003 Daniel Veillard <daniel@veillard.com>
+
+ * libxslt/attributes.c libxslt/xsltInternals.h libxslt/imports.c
+ libxslt/xslt.c: fixed bug #101003 on attribute-sets value
+ computation in the presence of imports
+ * tests/docs/Makefile.am tests/docs/bug-102.xml
+ tests/general/Makefile.am tests/general/bug-102*: added an
+ example in the regression tests for this case
+
Fri Jan 10 10:34:23 CET 2003 Daniel Veillard <daniel@veillard.com>
* xsltproc/xsltproc.c: final touch to #102800 fix
goto error;
}
- res = xsltParseStylesheetDoc(import);
+ res = xsltParseStylesheetImportedDoc(import);
if (res != NULL) {
res->parent = style;
res->next = style->imports;
template->content = doc->children;
xsltAddTemplate(ret, template, NULL, NULL);
}
- xsltResolveStylesheetAttributeSet(ret);
return(ret);
}
/**
- * xsltParseStylesheetDoc:
+ * xsltParseStylesheetImportedDoc:
* @doc: and xmlDoc parsed XML
*
* parse an XSLT stylesheet building the associated structures
+ * except the processing not needed for imported documents.
*
* Returns a new XSLT stylesheet structure.
*/
xsltStylesheetPtr
-xsltParseStylesheetDoc(xmlDocPtr doc) {
+xsltParseStylesheetImportedDoc(xmlDocPtr doc) {
xsltStylesheetPtr ret;
if (doc == NULL)
ret->doc = doc;
xsltGatherNamespaces(ret);
- if (xsltParseStylesheetProcess(ret, doc) == NULL) {
- ret->doc = NULL;
- xsltFreeStylesheet(ret);
- ret = NULL;
- }
+ if (xsltParseStylesheetProcess(ret, doc) == NULL) {
+ ret->doc = NULL;
+ xsltFreeStylesheet(ret);
+ ret = NULL;
+ }
+
+ return(ret);
+}
+
+/**
+ * xsltParseStylesheetDoc:
+ * @doc: and xmlDoc parsed XML
+ *
+ * parse an XSLT stylesheet building the associated structures
+ *
+ * Returns a new XSLT stylesheet structure.
+ */
+
+xsltStylesheetPtr
+xsltParseStylesheetDoc(xmlDocPtr doc) {
+ xsltStylesheetPtr ret;
+
+ ret = xsltParseStylesheetImportedDoc(doc);
+ if (ret == NULL)
+ return(NULL);
+
+ xsltResolveStylesheetAttributeSet(ret);
return(ret);
}
void xsltParseStylesheetOutput(xsltStylesheetPtr style,
xmlNodePtr cur);
xsltStylesheetPtr xsltParseStylesheetDoc (xmlDocPtr doc);
+xsltStylesheetPtr xsltParseStylesheetImportedDoc(xmlDocPtr doc);
xsltStylesheetPtr xsltLoadStylesheetPI (xmlDocPtr doc);
void xsltNumberFormat (xsltTransformContextPtr ctxt,
xsltNumberDataPtr data,
bug-99.xml \
bug-100.xml \
bug-101.xml \
+ bug-102.xml \
character.xml \
array.xml \
items.xml
bug-99.out bug-99.xsl \
bug-100.out bug-100.xsl \
bug-101.out bug-101.xsl \
+ bug-102.out bug-102.xsl \
+ bug-102-inc.out bug-102-inc.xsl \
character.out character.xsl \
character2.out character2.xsl \
itemschoose.out itemschoose.xsl \
--- /dev/null
+<font text-align="start" size="+1">
+ foo
+ </font>
--- /dev/null
+<?xml version="1.0"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:output method="html"/>
+
+ <xsl:attribute-set name="foo-attribs">
+ <xsl:attribute name="size">+1</xsl:attribute>
+ </xsl:attribute-set>
+
+ <xsl:attribute-set name="foo-dep-attribs"
+ use-attribute-sets="foo-attribs">
+ <xsl:attribute name="text-align">start</xsl:attribute>
+ </xsl:attribute-set>
+
+ <xsl:template match="/">
+ <font xsl:use-attribute-sets="foo-dep-attribs">
+ foo
+ </font>
+ </xsl:template>
+
+</xsl:stylesheet>
--- /dev/null
+<font text-align="start" size="+2">
+ foo
+ </font>
--- /dev/null
+<?xml version="1.0"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:import href="bug-102-inc.xsl"/>
+
+ <xsl:attribute-set name="foo-attribs">
+ <xsl:attribute name="size">+2</xsl:attribute>
+ </xsl:attribute-set>
+
+</xsl:stylesheet>