added a example in the regression tests for a case where the XML default

* tests/docs/Makefile.am tests/docs/bug-87.xml
  tests/general/Makefile.am tests/general/bug-87.*: added a
  example in the regression tests for a case where the XML
  default namespace was missing from the namespace axis
* xsltproc/xsltproc.c: added the informations that parameter
  strings are expected to be UTF8
* libxslt/attributes.c: fixes on attribute group implementation
Daniel
This commit is contained in:
Daniel Veillard 2002-07-01 22:19:55 +00:00
parent 37880c60fd
commit 5ebd21a46b
8 changed files with 55 additions and 17 deletions

View File

@ -1,3 +1,13 @@
Tue Jul 2 00:02:53 CEST 2002 Daniel Veillard <daniel@veillard.com>
* tests/docs/Makefile.am tests/docs/bug-87.xml
tests/general/Makefile.am tests/general/bug-87.*: added a
example in the regression tests for a case where the XML
default namespace was missing from the namespace axis
* xsltproc/xsltproc.c: added the informations that parameter
strings are expected to be UTF8
* libxslt/attributes.c: fixes on attribute group implementation
Sat Jun 29 21:12:14 MDT 2002 John Fleck <jfleck@inkstain.net>
* doc/xsltproc.xml, doc/xsltproc.html/, doc/xsltproc.1

View File

@ -619,22 +619,21 @@ xsltAttributeInternal(xsltTransformContextPtr ctxt, xmlNodePtr node,
if ((fromset) && (ns != NULL))
URL = ns->href;
if ((fromset == 0) || (!xmlHasNsProp(ctxt->insert, name, URL))) {
value = xsltEvalTemplateString(ctxt, node, inst);
if (value == NULL) {
if (ns) {
attr = xmlSetNsProp(ctxt->insert, ns, name,
(const xmlChar *) "");
} else {
attr =
xmlSetProp(ctxt->insert, name, (const xmlChar *) "");
}
value = xsltEvalTemplateString(ctxt, node, inst);
if (value == NULL) {
if (ns) {
attr = xmlSetNsProp(ctxt->insert, ns, name,
(const xmlChar *) "");
} else {
if (ns) {
attr = xmlSetNsProp(ctxt->insert, ns, name, value);
} else {
attr = xmlSetProp(ctxt->insert, name, value);
}
attr =
xmlSetProp(ctxt->insert, name, (const xmlChar *) "");
}
} else {
if (ns) {
attr = xmlSetNsProp(ctxt->insert, ns, name, value);
} else {
attr = xmlSetProp(ctxt->insert, name, value);
}
}

View File

@ -86,6 +86,7 @@ EXTRA_DIST = \
bug-83.xml \
bug-84.xml \
bug-86.xml \
bug-87.xml \
character.xml \
array.xml \
items.xml

6
tests/docs/bug-87.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0"?>
<XML_DATA>
<AAA xmlns:fish="tuna"/>
<CCC/>
</XML_DATA>

View File

@ -89,6 +89,7 @@ EXTRA_DIST = \
bug-83.out bug-83.xsl \
bug-84.out bug-84.xsl \
bug-86.out bug-86.xsl \
bug-87.out bug-87.xsl \
character.out character.xsl \
character2.out character2.xsl \
itemschoose.out itemschoose.xsl \

5
tests/general/bug-87.out Normal file
View File

@ -0,0 +1,5 @@
AAA - "xml" "fish"
CCC - "xml"

16
tests/general/bug-87.xsl Normal file
View File

@ -0,0 +1,16 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
version="1.0">
<xsl:output method="text"/>
<xsl:template match="/XML_DATA//*">
<xsl:value-of select="name()"/>
<xsl:text> - </xsl:text>
<xsl:for-each select="namespace::*">
<xsl:text> &quot;</xsl:text>
<xsl:value-of select="name()"/>
<xsl:text>&quot; </xsl:text>
</xsl:for-each>
<xsl:text>
</xsl:text>
</xsl:template>
</xsl:stylesheet>

View File

@ -376,10 +376,10 @@ static void usage(const char *name) {
printf("\t--docbook: the input document is SGML docbook\n");
#endif
printf("\t--param name value : pass a (parameter,value) pair\n");
printf("\t value is an XPath expression.\n");
printf("\t value is an UTF8 XPath expression.\n");
printf("\t string values must be quoted like \"'string'\"\n or");
printf("\t use stringparam to avoid it\n");
printf("\t--stringparam name value : pass a (parameter,string value) pair\n");
printf("\t--stringparam name value : pass a (parameter, UTF8 string value) pair\n");
printf("\t--nonet refuse to fetch DTDs or entities over network\n");
#ifdef LIBXML_CATALOG_ENABLED
printf("\t--catalogs : use SGML catalogs from $SGML_CATALOG_FILES\n");