summaryrefslogtreecommitdiff
path: root/libxslt/namespaces.c
Commit message (Collapse)AuthorAgeFilesLines
* Avoid an error in namespace generationMartin2009-09-171-0/+4
| | | | | * libxslt/namespaces.c: fix xsltGetSpecialNamespace fallback with uninitialized prefix string
* applied patch from Peter Pawlowski fixing a timezone offset problem, fixesDaniel Veillard2008-04-031-4/+4
| | | | | | | | | * libexslt/date.c: applied patch from Peter Pawlowski fixing a timezone offset problem, fixes #521680 * libxslt/namespaces.c: a bit of space/tabs cleanup Daniel svn path=/trunk/; revision=1462
* added setting of TRIO_REPLACE_STDIO when TRIO routines are required.William M. Brack2007-03-021-0/+5
| | | | | | | | | | * xsltconfig.h.in: added setting of TRIO_REPLACE_STDIO when TRIO routines are required. * namespaces.c, xsltutils.c: enhanced handling of stdio.h vs. trio.h when trio routines are required (now use XSLT_NEED_TRIO) (bug #412787) svn path=/trunk/; revision=1423
* Fixed problem with cleanup of RVT's, should clear bug350085; cleaned upWilliam M. Brack2006-08-091-2/+2
| | | | | | | | * libxslt/transform.c: Fixed problem with cleanup of RVT's, should clear bug350085; cleaned up most warnings (still a problem in xsltShallowCopyNsNode) * trivial warning cleanup in libxslt/[extensions.c, namespaces.c, xslt.c and xsltInternals.h] and libexslt/functions.c
* Committing again, since I forgot to switch from win to linux linebreaks inKasimier T. Buchcik2006-07-141-842/+842
| | | | | | | | | | | | | * libxslt/attributes.c libxslt/documents.c libxslt/functions.c libxslt/keys.c libxslt/namespaces.c libxslt/pattern.c libxslt/preproc.c libxslt/templates.c libxslt/templates.h libxslt/transform.c libxslt/variables.c libxslt/xslt.c libxslt/xsltInternals.h libxslt/xsltutils.c libxslt/xsltutils.h libexslt/common.c libexslt/dynamic.c libexslt/functions.c libexslt/strings.c: Committing again, since I forgot to switch from win to linux linebreaks in the files.
* Refactored xsltValueOf(). Changed to use xmlXPathCastToString() directly,Kasimier T. Buchcik2006-07-141-844/+842
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libxslt/attributes.c libxslt/documents.c libxslt/functions.c libxslt/keys.c libxslt/namespaces.c libxslt/pattern.c libxslt/preproc.c libxslt/templates.c libxslt/templates.h libxslt/transform.c libxslt/variables.c libxslt/xslt.c libxslt/xsltInternals.h libxslt/xsltutils.c libxslt/xsltutils.h libexslt/common.c libexslt/dynamic.c libexslt/functions.c libexslt/strings.c: Refactored xsltValueOf(). Changed to use xmlXPathCastToString() directly, rather than creating an intermediate object with xmlXPathConvertString(). This now does not add a text-node to the result if the string is empty (this has impact on serialization, since an empty text-node is serialized as <foo></foo>, and now it will be serialized as <foo/>). Refactored other functions in transform.c: Mostly code cleanup/restructuring. Minimized number of function variables for instruction which eat up function stack memory when recursing templates (xsltIf(), xsltChoose(), xsltApplyTemplates(), xsltCallTemplate()). Changed XSLT tests to use xmlXPathCompiledEvalToBoolean(). Implemented redefinition checks at compilation-time and eliminating them at transformation time in the refactored code paths. Introduced the field @currentTemplateRule on xsltTransformContext to reflect the "Current Template Rule" as defined by the spec. NOTE that ctxt->currentTemplateRule and ctxt->templ is not the same; the former is the "Current Template Rule" as defined by the XSLT spec, the latter is simply the template struct being currently processed by Libxslt. Added XML_COMMENT_NODE and XML_CDATA_SECTION_NODE to the macro IS_XSLT_REAL_NODE. Misc code cleanup/restructuring and everything else I already forgot. Refactored lifetime of temporary result tree fragments. Substituted all calls to the now deprecated xsltRegisterTmpRVT() for the new xsltRegisterLocalRVT(). Fragments of xsl:variable and xsl:param are freed when the variable/pram is freed. Fragments created when evaluating a "select" of xsl:varible and xsl:param are also bound to the lifetime of the var/param. EXSLT's func:function now uses the following functions to let take care the transformation's garbage collector of returned tree fragments: xsltExtensionInstructionResultRegister(), xsltExtensionInstructionResultFinalize() Fixes: #339222 - xsl:param at invalid position inside an xsl:template is not catched #346015 - Non-declared caller-parameters are accepted #160400 - Compiles invalid XSLT; unbound variable accepted #308441 - namespaced parameters become unregistered #307103 - problem with proximity position in predicates of match patterns #328218 - problem with exsl:node-set() when converting strings to node sets #318088 - infinite recursion detection #321505 - Multiple contiguous CDATA in output #334493 - "--param" option does not have root context #114377 - weird func:result/xsl:variable/exsl:node-set interaction #150309 - Regression caused by fix for 142768
* Merged all the namespace lookup/create/disable functions intoKasimier T. Buchcik2006-06-191-349/+362
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libxslt/attributes.c libxslt/attrvt.c libxslt/namespaces.c libxslt/namespaces.h libxslt/preproc.c libxslt/templates.c libxslt/transform.c libxslt/variables.c libxslt/xslt.c libxslt/xsltInternals.h libxslt/xsltutils.c: Merged all the namespace lookup/create/disable functions into xsltGetSpecialNamespace(). Changed xsltGetNamespace() and xsltGetPlainNamespace() to call xsltGetSpecialNamespace(), but kept the ns-aliasing mechanism; the ns-aliasing needs to be removed when we move to the refactored code, which applies ns-alias only at compilaton time. Refactored xsltElementComp() (preproc.c); enhanced error reports. Fixed: if the "namespace" attribute was not given, then this performed incorrectly only a lookup for a default namespace; i.e., without taking any prefix on the "name" attribute into account. Refactored xsltElement() (transform.c); enhanced error reports. Refactored xsltAttributeComp() (preproc.c). Added namespace lookup as in xsltElementComp(). Enhanced error reports. Refactored xsltAttribute() (transform.c); enhanced error reports. xsltCopyTreeInternal(): eliminated the need to call xmlGetNsList() for every element in the tree; this needs to be done only for the top-most elements. For subsequent elements reconcile only the ns-declarations. Disallowed setting of ns-declarations if children have been already added to an element. Removed ns-aliasing code where necessary. xsltCopyProp(): disallowed setting of attribute nodes if children have been already added to an element. xsltCopy(): removed the incorrect skipping of attributes in the XSLT namespace. Removed the incorrect ns-aliasing for attributes. Changed to use the introduced function xsltShallowCopyAttr(). xsltShallowCopyAttr(): Centralized all attribute-copy related code in this function. It will now be called by xsltCopyTreeInternal(), xsltCopyOf() and xsltCopy(). xsltCopyAttrListNoOverwrite(): Renamed. Refactored. Optimized to use xsltGetSpecialNamespace() and xmlNewDocProp(). Further substitution of various scattered namespace-lookup related code for the use of xsltGetSpecialNamespace(). xsltAttrTemplateProcess(): Refactored. Removed the incorrect processing of attribute-sets. Attribute sets need to be applied before adding any normal attribute of the literal result element; this is now done in xsltAttrListTemplateProcess(). Fixed to ensure that the ns-prefix of the overwriting attribute is used. xsltAttrListTemplateProcess(): Refactored. Moved semantics from xsltAttrTemplateProcess() over to this function in order to optimize processing of multiple attributes. This does not call xsltAttrTemplateProcess() anymore. Fixed: do not exclude the XSLT namespace after ns-aliasing have beed applied. The IFDEFed-out refactored code fixes the following issues: - #313711: namespace collision with namespace-alias (reported by by Oleg Paraschenko) - #338214: Incorrect scope for exclude-result-prefixes - #341392: Excluding namespace declarations of literal result elements. - #341325: Namespace aliasing and resulting namespace prefixes Already enabled fixes: - #344183: xsl:copy misses to copy attributes in the XSLT namespace - #341463: Namespace-alias using #default for result-prefix with no default namespace in scope - #313890: namespace collision with xsl:element and xsl:attribute, reported by Oleg Paraschenko - #344176: xsl:copy misses to set an element's namespace-URI in some cases - #305739: the "name" QName of xsl:element is incorrectly always resolved to the default namespace
* Fixed bug #302020, reported by Thomas Blatter.Kasimier T. Buchcik2006-05-151-2/+26
| | | | | * libxslt/namespaces.c libxslt/attributes.c: Fixed bug #302020, reported by Thomas Blatter.
* Next step of refactoring. For more details see bug #341588. I applied theKasimier T. Buchcik2006-05-121-79/+294
| | | | | | | | | | | | | * libxslt/documents.c libxslt/namespaces.c libxslt/preproc.c libxslt/transform.c libxslt/xslt.c libxslt/xsltInternals.h libxslt/xsltutils.c: Next step of refactoring. For more details see bug #341588. I applied the suggestion of Jerome Pesenti to the refactored (still IDFEDed out with XSLT_REFACTORED) code: The XPath compilation context (accessible via the compilation context) is now reused for compilation of expressions at compilation-time; this should reduce compilation time to 50% for avarage stylesheets.
* Eliminated usage of xsltGetNsProp() in cases where an attribute with aKasimier T. Buchcik2006-03-301-4/+2
| | | | | | | | | | | | | | | | | | * libxslt/xslt.c libxslt/xsltutils.c libxslt/preproc.c libxslt/namespaces.c libxslt/imports.c libxslt/attributes.c: Eliminated usage of xsltGetNsProp() in cases where an attribute with a specific namespace is requested. xsltGetNsProp() uses xmlGetProp() which is not namespace aware and thus will return the first attribute with the requested name but of arbitrary namespace. Changed retrieval of the attributes "exclude-result-prefixes" and "extension-element-prefixes", which are expected to be in no namespace on XSLT elements and in the XSLT namespace on literal result elements or extension elements. Additional change: for XSLT elements the attribute "exclude-result-prefixes" is only allowed on xsl:stylesheet and xsl:transform. This attribute was previously processed on all XSLT elements.
* fixed a problem with exclude-result-prefixes (bug 165560)William M. Brack2005-02-141-4/+11
| | | | | * libxslt/namespaces.c: fixed a problem with exclude-result-prefixes (bug 165560)
* changed some variable names for warning cleanup when -ansi flag is notWilliam M. Brack2004-10-231-10/+12
| | | | | | | | | * libexslt/crypto.c, libexslt/functions.c, libxslt/keys.c, libxslt/numbers.c, libxslt/pattern.c, libxslt/transform.c, libxslt/variables.c: changed some variable names for warning cleanup when -ansi flag is not present. * libxslt/namespaces.c: fixed potential NULL pointer reference pointed out by Dennis Dams (bug 156187)
* fixed a bug in namespace lookup exhibited by the recent namespace tests inDaniel Veillard2004-10-111-0/+3
| | | | | | * libxslt/namespaces.c: fixed a bug in namespace lookup exhibited by the recent namespace tests in libxml2 Daniel
* fixed handling of #default in namespace-alias for default namespace (bugWilliam M. Brack2004-08-151-21/+74
| | | | | | | * libxslt/namespaces.[ch], transform.c, xslt.c, xsltInternals.h: fixed handling of #default in namespace-alias for default namespace (bug 149659) * tests/namespaces/tst7.* tst8.*: added regression tests for above
* some enhancement for fixing bug 142768 added regression test for this bugWilliam M. Brack2004-06-301-8/+17
| | | | | | * libxslt/namespaces: some enhancement for fixing bug 142768 * tests/namespaces/Makefile.am, tests/namespaces/tst6*: added regression test for this bug
* fixing bug #134500 on namespace lookup for attribute which sometimes leadDaniel Veillard2004-05-161-0/+155
| | | | | | | | | | * libxslt/namespaces.c libxslt/namespaces.h libxslt/templates.c libxslt/transform.c: fixing bug #134500 on namespace lookup for attribute which sometimes lead to default namespace * tests/general/bug-150*, tests/docs/bug-150.xml, tests/general/Makefile.am, tests/docs/Makefile.am: added regression test for bug #134500 Daniel
* added additional check to prevent superfluous namespace href's beingWilliam M. Brack2004-03-121-1/+6
| | | | | | | | | | | * libxslt/namespaces.c: added additional check to prevent superfluous namespace href's being generated on elements (bug 136914) * tests/namespaces/Makefile.am, tests/namespaces/tst5.x[ms]l: added new test for bug 136914 * tests/namespaces, tests/extensions/ tests/reports: fixed error in "enhanced" Makefile.am, removed superfluous .err files from cvs
* fixed problem with attribute namespace (Bug 132953)William M. Brack2004-01-311-1/+1
| | | | | * libxslt/namespaces.c: fixed problem with attribute namespace (Bug 132953)
* fixed #106554 for spurious xmlns:nsX="" generation DanielDaniel Veillard2003-02-241-0/+9
| | | | | | * libxslt/namespaces.c: fixed #106554 for spurious xmlns:nsX="" generation Daniel
* fixed bug #106789 from James Clark and a bit of cleanup added the exampleDaniel Veillard2003-02-231-2/+10
| | | | | | | | | * libxslt/namespaces.c libxslt/transform.c: fixed bug #106789 from James Clark and a bit of cleanup * tests/docs/Makefile.am tests/docs/bug-104.xml tests/general/Makefile.am tests/general/bug-104*: added the example in the regression tests for this case Daniel
* add a line in %changelog for releases DanielDaniel Veillard2002-11-251-1/+1
| | | | | * libxslt.spec.in configure.in: add a line in %changelog for releases Daniel
* added the possibility to register a transformation context specific errorDaniel Veillard2002-10-151-10/+5
| | | | | | | | | | | | * libxslt/xsltInternals.h libxslt/xsltutils.[ch]: added the possibility to register a transformation context specific error handler, with xsltSetTransformErrorFunc() and provided a new routine xsltTransformError() to handle contextual errors, this should fix #94435 * libxslt/*.c: modified all the code to use the context specific error handling, as a result xsltPrintErrorContext() is not called anymore except internally from xsltTransformError() Daniel
* closing #94933, any error will make the transformation abort with noDaniel Veillard2002-10-151-2/+12
| | | | | | | | | | | | | * libxslt/transform.c: closing #94933, any error will make the transformation abort with no result. * tests/reports/tst-1.err tests/reports/tst-1.out tests/reports/undefvar.err: this changed the regression tests output. * tests/exslt/date/difference.1.out tests/exslt/date/seconds.1.out: updated the result accordingly to the fixes done last month. * libxslt/namespaces.c: make sure to avoid duplicate namespace declarations in the result trees. May fix #93692 but it's unclear. Daniel
* fix bug #81099 about duplicated namespace declarations, this might not beDaniel Veillard2002-05-271-0/+6
| | | | | | | * libxslt/namespaces.c libxslt/transform.c: fix bug #81099 about duplicated namespace declarations, this might not be as generic as it should but works well for DocBook stylesheets Daniel
* preparing 1.0.14 updated rebuilt implemented the IN_LIBXSLT andDaniel Veillard2002-03-181-0/+1
| | | | | | | | | * configure.in: preparing 1.0.14 * doc/*: updated rebuilt * libxslt/*.c libexslt/*.c libxslt/libxslt.h libexslt/libexslt.h: implemented the IN_LIBXSLT and IN_LIBEXSLT mechanism discussed with the Windows maintainers Daniel
* small fixups related to the XPath changes in fixing #61290 DanielDaniel Veillard2002-03-041-0/+2
| | | | | | * libxslt/namespaces.c tests/general/bug-63.out: small fixups related to the XPath changes in fixing #61290 Daniel
* provide context for error messages. Requires libxml head changes. fixed aDaniel Veillard2001-07-121-0/+5
| | | | | | | | | | | | * libxslt/documents.c libxslt/extensions.c libxslt/extra.c libxslt/functions.c libxslt/imports.c libxslt/keys.c libxslt/namespaces.c libxslt/numbers.c libxslt/pattern.c libxslt/preproc.c libxslt/templates.c libxslt/transform.c libxslt/variables.c libxslt/xslt.c: provide context for error messages. Requires libxml head changes. * libxslt/xsltutils.c libxslt/xsltutils.h: fixed a --profile problem Daniel
* added configuration/version informations for Windows/MSC internal headerDaniel Veillard2001-06-281-2/+2
| | | | | | | | | | | | * libxslt/xsltwin32config.h[.in]: added configuration/version informations for Windows/MSC * libxslt/libxslt.h libxslt/*.c: internal header to centralize includes switches * libxslt/Makefile.am: added libxslt.h and xsltwin32config.h[.in] * libxslt/*.[ch] libxslt/*.in: quite a bit of cleanup, especially the email addresses * AUTHORS: added William Daniel
* - libxslt/namespaces.[ch]: added a single namespace def copyDaniel Veillard2001-06-161-0/+52
| | | | | | | | | | | | operation xsltCopyNamespace(). cleaned up xsltCopyNamespaceList() - libxslt/transform.c: cleaned up xsltCopyNode to cope with any kind of input nodes. - libxslt/variables.c: checked and closed the last TODO about namespace propagation - tests/docs/Makefile.am tests/general/Makefile.am tests/general/bug-38-* tests/docs/bug-38-*: added a specific regression test for #56115 Daniel
* - libxslt/xsltutils.[ch]: closing bug #55683 required to addDaniel Veillard2001-06-071-2/+2
| | | | | | | | | | | xsltGetNsProp() - libxslt/attributes.c libxslt/imports.c libxslt/namespaces.c libxslt/preproc.c libxslt/templates.c libxslt/xslt.c: Updated to use the new function - tests/XSLTMark/prettyprint.out tests/docbook/result/html/*.html: the fixes in the serialization of <pre> in HTML in libxml led to a number of changes in the output Daniel
* - libxslt/functions.c libxslt/transform.c libxslt/xsltInternals.h:Daniel Veillard2001-05-171-1/+1
| | | | | | | | | add ctxt->inst to allow stylesheet element lookup (needed for document() fix) - libxslt/*.[ch]: generate docs for the structures and macros, general cleanup for docs - doc/html/*.html: regenerated all docs Daniel
* And most of this is simply untested, yet...:Daniel Veillard2001-02-021-0/+45
| | | | | | | | - FEATURES: updated - transform.c: added xsl:element support - namespaces.[ch]: added xsltGetSpecialNamespace() - attributes.c: added xsl:attribute namespace support. Daniel
* Work on implementing import support:Daniel Veillard2001-02-011-7/+15
| | | | | | | | | | - libxslt/Makefile.am libxslt/imports.[ch]: new module to implement import cascade lookups and traversal - libxslt/attributes.c libxslt/namespaces.c libxslt/pattern.[ch] libxslt/transform.c libxslt/xslt.c libxslt/xsltInternals.h: started coding the import cascade lookup in the places needed, probably incomplete. Daniel
* Testing/debugging: - tests/REC/test-7.*: added more tests -Daniel Veillard2001-01-301-7/+22
| | | | | | | | | Testing/debugging: - tests/REC/test-7.*: added more tests - libxslt/namespaces.[ch] libxslt/pattern.c libxslt/attributes.c libxslt/templates.c libxslt/transform.c libxslt/xslt.c: fixing bugs raised by said tests Daniel
* Work done on namespace support:Daniel Veillard2001-01-281-0/+204
- FEATURES TODO: updates - libxslt/namespaces.[ch] libxslt/templates.c libxslt/transform.c libxslt/xslt.c libxslt/xsltInternals.h: added support for namespace aliases and cleaned up the overall namespace related code. This materialize as a new module. Daniel