Add iXML support - #239
Add iXML support#239marmoure wants to merge 18 commits into
Conversation
Not up to standards ⛔
|
f083ffd to
fe29b7c
Compare
adamretter
left a comment
There was a problem hiding this comment.
Looks very good so far, thank you @marmoure just some small changes and a few more tests please
| @Deprecated | ||
| public static final ErrorCode FOXT0006 = W3CErrorCode.FOXT0006.errorCode; | ||
|
|
||
| /** |
There was a problem hiding this comment.
@marmoure Please removed these deprecated ones. Adding deprecated code does not make much sense to me.
|
|
||
| public class FnInvisibleXmlTest { | ||
|
|
||
| // xquery version "3.1"; |
There was a problem hiding this comment.
Please remove all these comments!
| // return $parser-fail-on($alphabit-invalid-input) | ||
|
|
||
| @ClassRule | ||
| public static final ExistXmldbEmbeddedServer existEmbeddedServer = new ExistXmldbEmbeddedServer(false, true, true); |
There was a problem hiding this comment.
As existEmbeddedServer is a static variable it should be in upper-case, i.e.: EXIST_EMBEDDED_SERVER.
|
|
||
| @Test | ||
| public void alphabitInvalidInputFailOnError() { | ||
| assertError("FOIX0002", parseQuery(ALPHABIT_GRAMMAR, FAIL_ON_ERROR_OPTIONS, ALPHABIT_INVALID_INPUT)); |
There was a problem hiding this comment.
Please link the error code from ErrorCodes.java rather than reproducing here as a string.
| private static final String FAIL_ON_ERROR_OPTIONS = "map { \"fail-on-error\": true() }"; | ||
|
|
||
| @Test | ||
| public void dateValidInput() throws XMLDBException { |
There was a problem hiding this comment.
I think we are missing tests for NO_GRAMMAR - combined with and without options.
|
|
||
| <dependency> | ||
| <groupId>de.bottlecaps</groupId> | ||
| <artifactId>markup-blitz</artifactId> |
There was a problem hiding this comment.
Which version of Java does this require? Will it be compatible with Elemental 6.x.x (JDK 8)?
| @@ -584,6 +584,12 @@ | |||
| <!-- scope>test</scope --> <!-- not just test scope, as needed for org.exist.test --> | |||
There was a problem hiding this comment.
You need to update the license plugin file details in exist-core/pom.xml please
| private static final StringValue FAIL_ON_ERROR_KEY = new StringValue("fail-on-error"); | ||
|
|
||
| @Nullable | ||
| final Either<StringValue, Element> grammar; |
There was a problem hiding this comment.
At the moment, grammar can not be null, only its left value could be null.
What we really have in the code at the moment is:
final Either<@Nullable StringValue, Element> grammar;
I think it might be better to change the code so that grammar can be null, and the left or right value is never null please.
| final String input = inputArg.getStringValue(); | ||
|
|
||
| final String ixmlGrammar; | ||
| if (grammar == null) { |
There was a problem hiding this comment.
I am not sure that grammar can be null?
| try (final StringBuilderWriter writer = new StringBuilderWriter()) { | ||
| final XQuerySerializer xqSerializer = new XQuerySerializer( | ||
| context.getBroker(), new Properties(), writer); | ||
| xqSerializer.serialize((Sequence) grammar.right().get()); |
There was a problem hiding this comment.
Would serialization be avoidable if we used CoffeePot instead of Blitz?
This PR adds the
fn:invisible-xml()function according to the QT4 spec - https://qt4cg.org/specifications/xpath-functions-40/Overview.html#func-invisible-xml