Commit graph

225 commits

Author SHA1 Message Date
jez
53c647c1a1 Changed default text handling. Text containing only whitespace is now output, where previously it was suppressed.
All Modes tests now pass.
2008-08-01 19:33:52 +01:00
jez
6a2101d6cb Verify qNames when processing. 2008-08-01 19:20:28 +01:00
jez
3a3f5d4b32 Validate xsl:stylesheet attributes properly 2008-08-01 19:19:49 +01:00
jez
f14cb010a3 added is_qname function, and tests 2008-08-01 13:02:41 +01:00
jez
e0fcea7d71 added is_ncname_char 2008-08-01 13:02:21 +01:00
jez
353ad2fa91 corrected copyright date 2008-07-29 19:50:33 +01:00
jez
f29fbced15 libxml2 and xerces wrappers now build again 2008-07-17 10:00:32 +01:00
jez
88de9056da build through on cygwin with expat 2008-07-16 10:01:08 +01:00
jez
ce8fb28f5f added get_string_adaptor as a slightly less typing version of using get_param to pull it 2008-07-16 09:08:59 +01:00
jez
707cd47f41 After all this time realised I had too many template parameters on the
XMLReaderInterface template.  It is only interested in string_type and 
string_adaptor.  All the fancy TMP to extract types and what not 
is only relevant in *_wrapper classes.
2008-07-15 18:59:03 +01:00
jez
01cfd6eef7 build files for VS2008 2008-07-15 09:10:43 +01:00
jez
3d62ee558e Applied Michael Fink's Win32 expat patch 2008-07-07 17:00:11 +01:00
jez
04e0cb5952 craigp's patch for Xerces 2.8 2008-07-04 23:06:37 +01:00
jez
1719005582 updated for gcc 4.3.1 2008-07-03 21:43:56 +00:00
jez
1b1b5d2072 fixed typedef 2008-06-26 13:37:17 +00:00
jez
508536ee27 Patches so that we can build successfully without Boost. 2008-06-26 13:34:00 +00:00
jez
1431e900e9 throw error if transform is run with no input 2008-06-04 20:30:36 +00:00
jez
73d0cdaef9 fixed for other than std::strings 2008-05-30 21:45:27 +00:00
jez
3874438091 Include default namespace when constructing namespace nodes 2008-05-28 16:37:15 +00:00
jez
9ba32a5160 corrected compareNodes for the case where the two nodes are from different documents 2008-05-28 15:08:58 +00:00
jez
2e1b775e71 changed the handling of RelativeLocationPath token when building a step list. There might be things following the path, and must take them into account. Test position89 exposed a problem prompting this change. 2008-05-28 15:08:35 +00:00
jez
53fbf26ff0 Correctly implemented Namespace Nodes.
The XPath data model requires that namespace nodes are associated with an element, and sort ahead of attribute nodes in document order.  Until now, Arabica's namespace node had no parent, or owner document and so was failing these requirements.  The Xalan position111 test case highlights this requirement.
2008-05-28 08:53:21 +00:00
jez
5d7f3364ba Visual Studio, how I curse your useless warning C4800 2008-05-28 08:45:25 +00:00
jez
f89a2be3cc fix in MultiplicativeExpr rule for Boost 1.35 2008-05-04 18:10:03 +00:00
jez
261f589f47 2008-05-04 14:41:23 +00:00
jez
51e4cad4a0 marked functions as inline as requested, although not entirely sure if it should be necessary :) 2008-04-28 09:13:49 +00:00
jez
84d7d9390a spelled underlying_impl wrong all these years and never realised, start work on sorting namespace nodes ahead of attribute nodes 2008-04-23 14:41:00 +00:00
jez
c6564e798c added missing typename 2008-04-23 14:39:11 +00:00
jez
f818f192af fixed match rewriting when there are leading predicates - http://www.jezuk.co.uk/jez/2008April#3711 2008-04-18 09:11:51 +00:00
jez
a049a72c08 fixed sorting bug when reverse sorting a nodeset which includes the root node 2008-04-17 20:32:32 +00:00
jez
9ea360f3ef collapsed tagsoup-port into mainline 2008-04-07 15:37:47 +00:00
jez
ebbd739051 initialise lexicalHandler_ 2008-02-08 16:01:38 +00:00
jez
71b7af819f xsl:sort - blow up if we get a lang attribute 2008-01-19 22:45:48 +00:00
jez
7bd88a7bbe 2007-12-25 22:23:25 +00:00
jez
0850f50269 tweaking document order across documents - not for any better reason than making a test case pass 2007-12-25 21:56:28 +00:00
jez
934a03e703 oops - ncnames don't contain colons 2007-12-23 22:52:39 +00:00
jez
95a3a42002 can see it now - uninitialised variable 2007-12-23 09:51:28 +00:00
jez
2e6c372933 hacked up a ncname test, although it's not working at the moment and I'm tired and can't think 2007-12-22 22:21:26 +00:00
jez
be877b8d50 MSVC can't handle static members in nest classes of template classes 2007-12-21 17:02:12 +00:00
jez
235f81718d Added Expression_scanner and scan (a visitor pattern basically) to allow XPathExpression_impls to be examined. This is used in the match rewriting to search for position() and last() function calls.
To ease implementing scan, BinaryExpression and UnaryExpression now inherit XPathExpression_impl.  Other classes now derived only from Binary|UnaryExpression rather than from XPathExpression_impl as well.
2007-12-21 15:56:04 +00:00
jez
a8ce93f89b First proper go at rewriting positional matches. 2007-12-21 14:13:36 +00:00
jez
cbc9cf3797 it's late 2007-12-20 23:24:16 +00:00
jez
f87c01fc53 2007-12-20 16:23:56 +00:00
jez
cdac22542e added type() to XPath expressions. I need this to allow XSLT match patterns to be rewritten properly - see http://www.jezuk.co.uk/cgi-bin/view/arabica/log?id=3546 - but it will also be useful for compile time checking (should I get sufficiently keen :) 2007-12-18 23:03:16 +00:00
jez
02fe02da03 "If the parser has not read a declaration for the attribute, or if the
parser does not report attribute types, then it must return the value
"CDATA" as stated in the XML 1.0 Recommentation (clause 3.3.3,
"Attribute-Value Normalization")."

and:
"Returns: The attribute's type as a string, or an empty string if the
index is out of range."

Problem found reported by Christoph Anderegg, christoph@anderegg-sommer.ch
and corrected with this commit.
2007-12-07 23:28:59 +00:00
jez
e659f3cce4 changed scope of StackFrame for apply templates 2007-11-26 23:17:11 +00:00
jez
213934528b xsl:stylesheet now allows top-level elements in a foreign namespace 2007-11-23 00:07:08 +00:00
jez
7c491700d3 disallow pcdata ahead of xsl:param 2007-11-22 23:02:08 +00:00
jez
6425632f01 blow up if QName is bad 2007-11-22 22:36:47 +00:00
jez
4ed4928695 check xsl:for-each selects a node-set, I suspect it should be able to diagnose this at compile time but it at least it fails :) 2007-11-22 21:54:51 +00:00
jez
c7c0c3d36c xsl:processing-instruction shouldn't allow xml as the name 2007-11-22 21:24:17 +00:00
jez
cdebc3d128 moved namespace and function resolver into compilation context. disallowed current() in match patterns 2007-11-22 19:24:18 +00:00
jez
375a2d584f no longer expose xpath compiler directly during XSLT compilation 2007-11-22 17:50:25 +00:00
jez
69a322f7f2 Alex Ott's patch to kill an initialisation order warning 2007-11-22 16:50:33 +00:00
jez
e2713a0fbc DOM stream now outputs <elem/> for empty elements 2007-11-22 16:49:25 +00:00
jez
95857fc467 detect duplicate variable and parameter names 2007-11-21 22:35:04 +00:00
jez
341d3db1ac reworked stylesheet compiler and inclusion to trap illegal elements as xsl:stylesheet's children 2007-11-21 22:34:15 +00:00
jez
a9a5858300 working on detecting illegal xsl:stylesheet children - including is currently broken 2007-11-20 23:12:08 +00:00
jez
a0083c14d2 '' 2007-11-19 22:11:05 +00:00
jez
0d385d1ab2 xsl:call-template throws if it can't find a matching template 2007-11-16 23:11:39 +00:00
jez
a9d7e1dcdd verify xsl:sort attribute values 2007-11-16 23:10:41 +00:00
jez
7962545efb Blow up if unknown child element encounter 2007-11-16 22:27:21 +00:00
jez
308cde7df7 xsl:templates - make sure any mode attribute is not empty 2007-11-16 22:05:42 +00:00
jez
bfe132b8a5 ensure xsl:choose has at least one xsl:when 2007-11-16 22:03:47 +00:00
jez
8f6b783dc7 don't actually need to worry about refcounting here - in fact even though I was keeping count, I wasn't actually doing anything with it :) 2007-11-12 09:06:25 +00:00
jez
67ad360326 tightened constness on DOMImplementation 2007-11-12 09:04:54 +00:00
jez
aacb33a3bd made destructor public 2007-11-12 09:03:47 +00:00
jez
7b5f83ee43 fixed for empty comment 2007-11-11 21:31:49 +00:00
jez
a1c71b3625 xsl:message can contain an xsl:message - now handled properly 2007-11-11 21:31:10 +00:00
jez
99a5d5cb85 fixed local-name for namespace nodes 2007-11-10 22:23:36 +00:00
jez
7912efaa62 Stream Document fragment nodes properly 2007-11-10 22:22:26 +00:00
jez
68a6d52d11 don't output attributes in the xsl namespace or declare the namespace itself 2007-11-08 23:05:46 +00:00
jez
2053c94f4a Use std::stable_sort instead of std::sort. When xsl:sort specifies a numerical sort, but you've got some string data in there we need to maintain the relative of that string data. This is the first time I've actually used std::stable_sort. I will mark it down in my big book of programming accomplishments. 2007-11-03 01:55:20 +00:00
jez
2231423e33 escape naughty text when outputting processing instructions and comments 2007-11-02 21:55:50 +00:00
jez
82f22d9dd3 changes to variable scoping in xsl:for-each, xsl:if, and xsl:choose. 2007-11-01 22:28:20 +00:00
jez
a52aafebd5 In XPath node() matches any node of any type. In an XSLT match pattern, node() matches everything except attributes and the document root node. Tweaked that match pattern grammar to introduce a new token in the AST. 2007-10-26 23:24:58 +00:00
jez
adbdb31f65 passed parameters are now unpassed when they aren't needed any more, removing them from the current stack frame. that may not match you idea of what a stack frame actually is (mine too, if I'm honest) but it's a straightforward change to fix a bug 2007-10-26 23:21:21 +00:00
jez
0167bd53c1 XSLT: template mode is now a QName 2007-10-26 19:12:27 +00:00
jez
b45e512845 XSLT: template names are now QNames 2007-10-26 12:28:48 +00:00
jez
3e246cb85a xsl:apply-imports - params are not passed on through an xsl:apply-imports call 2007-10-25 22:08:31 +00:00
jez
229a859c91 whitespace change 2007-10-25 20:58:27 +00:00
jez
fa235dc7af Fixed to AttributesImpl.getIndex from Isak Johnsson. Thanks go to him and a "what on earth was I thinking" to me. 2007-10-25 20:57:40 +00:00
jez
af3ebfde60 s/XPathExpressionPtr/XPathExpression/g 2007-10-25 20:42:00 +00:00
jez
a7d050841d s/XPathExpression/XPathExpression_impl/ 2007-10-23 21:37:24 +00:00
jez
fac7cf88de XPathExpressionPtr no longer derives from boost::shared_ptr, it contains it instead 2007-10-22 20:25:35 +00:00
jez
f6b2ed4966 OK, I think that's it. XPathValue is now your man. Existing code using XPathValuePtr should still work, but new stuff should use XPathValue 2007-10-22 17:42:50 +00:00
jez
6e2f594dc9 more reworking on XPathValuePtr -> XPathValue. XPathValue contains rather than derives from boost::shared_ptr. Added operator== so can still compare to 0 to see if the value is null or not. 2007-10-22 14:10:49 +00:00
jez
9b32ed13e4 Some time ago, it was gently suggested to me that XPathValuePtr and XPathExpressionPtr both exposed an implementation detail, because they derive fromboost::shared_ptr, and provided an interface that was inconsisted with the DOM classes, because you accessed the member functions via -> rather than .
At the time, I was just pleased to have got the XPath stuff done and wasn't really fussed, so I left it.  Since then though, it's niggled and niggled away at the back of my mind and now I've decided to do something about it.

XPathValuePtr will become XPathValue, with the member functions accessed through the . operator.  The XPathValuePtr name and -> member access will be retained for the meantime, so that existing code won't be broken.  XPathExpressionPtr will be similarly changed.

This commit is the first bit of that work, now I've satisfied myself it's going to be pretty easy so long as I pay proper attention.
2007-10-19 21:59:24 +00:00
jez
3f156c9fcf reworked MatchExpr so that it doesn't expose its inner XPathExpression 2007-10-14 20:06:27 +00:00
jez
3d5c7995cb added value_type typedef as per Evan Burkitt's suggestion 2007-10-05 14:56:26 +00:00
jez
889305618e fixes for older gcc 2007-09-28 08:30:16 +00:00
jez
494493d1c2 fixed template parameters in libxml2 binding 2007-09-25 21:43:25 +00:00
jez
6d76412103 fixed namespaces declaration 2007-09-25 19:17:58 +00:00
jez
c8a8be2fb7 fixed codecvt specialisation include paths 2007-09-19 17:33:23 +00:00
jez
1ffe707532 fixed codecvt specialisation include paths 2007-09-19 17:30:48 +00:00
jez
f213c402cd moved DOM streaming from Utils/ to io/ 2007-09-13 21:21:55 +00:00
jez
2a61c8f9df removed redundant includes 2007-09-11 08:44:00 +00:00
jez
723ef90108 the last, I think, of the namespace shuffling business 2007-09-11 08:32:54 +00:00
jez
c3bffa005a renamed include/Utils to include/Arabica 2007-09-10 17:52:04 +00:00
jez
8fe1e5f9c5 moved convert_adaptor and convertstream into Arabica::io namespace 2007-09-10 17:39:52 +00:00