Saxon Unexpected token " < e o f >" - xquery

I am evaluating Stylus Studio mainly for xquery development against XML payload exchanged using SOAP.
I've inherited a complex xquery (about 1800 lines) and when I try to execute it using Saxon as engine I get this error:
XPST0003: Xquery sintax error in ##:Unexpected token " < e o f >" in path expression.
This query works fine in AcquaLogic, so no really sure it's a bug in the file or Saxon.
Could anyone please give advise on this? At least to understand on which line it finds this token.
Thanks in advance

<EOF> means that Saxon encountered a literal "End of File" byte. Perhaps your path expression is corrupted? Other tools might ignore the EOF if they know the buffer is longer, but on that path lies madness.

Related

CallFailed error on parse

I am a intern trying to write my first Syntax using Rascal.
While programming i ran into an error that my tutor, Riemer van Rozen, had never seen before. At the moment i am still trying to see if the problem is my code or a Rascal bug but i felt like i should report the error here.
The syntax used to parse normally and even after putting the code back the way it was before I added new stuff it still gives the same error.
My Syntax file
module Syntax
lexical Natural = [0-9]+ !>> [0-9] ;
lexical ID = [a-zA-Z][a-z0-9A-Z]* !>> [a-z0-9A-Z];
lexical String = "\"" ![\"]* "\"";
lexical Sym = [a-zA-Z.!##$%^&*];
lexical Mp = Sym*;
layout WhiteSpace = [\t-\n \r]* ;
start syntax CreatorData
= title: "title " ID title
| author: "author " ID author
| homepage: "homepage " ID homepage;
Parser
module Parser
import Syntax;
import AST;
import ParseTree;
public CreatorData load(str txt) = parse(#CreatorData, txt);
The Error
I hope someone can tell me where i am breaking my program or that i pointed out an unknown Rascal bug.
Call failed means that the call of parse failed, since the arguments you supplied, did not match any of the possible overloads of parse.
For your code, it looks like you also have an ADT called CreatorData. This is overlapping with the CreatorData syntax definition. There is a pattern documented in the tutor how to work around this challenge.
Not sure about your case, but often you can skip the ADT form, and just work on the concrete trees, but that might be something to explore in the future.

Syntax error when working on OCaml/LLVM tutorial

I am reading the tutorial of implementing kaleidoscope language on LLVM using ocaml. However, the given code lexer.ml doesn't compile...
There is a syntax error in the second line of the code
let rec lex = parser
(* Skip any whitespace. *)
| [< ' (' ' | '\n' | '\r' | '\t'); stream >] -> lex stream
Why is this happening? Thank you.
This is an old stream syntax, provided by camlp4. See the tutorial. Enabling the syntax support highly depends on your build system. Please, provide more information on that, and I will update the posting.

Openmdao 1.7.3 error with unicode variables in python2

In the file openmdao/core/problem.py on lines such as 1619 and 1638, it checks if a variable is a string by using:
isinstance(inp, str)
however, this will return false if inp is unicode in python2, and eventually cause the program to raise an exception. In python2, the correct syntax is:
isinstance(inp, basestring)
I understand that basestring is not available in python 3, but there are several ways to write python 2/3 compatible code. Can this be fixed?
feel free to submit a pull request, but please add a test that checks the new functionality

ASP. NET Error: XML literal cannot appear here unless it is enclosed in parentheses

I am attempting to port some old asp to asp.net. Following this Microsoft tutorial! I am going through the errors and this XML one has me stuck. I have placed the opening and closing parenthesis in several places, but I am still getting the error. I'm sure this is something I'm overlooking, so any help is welcomed.
IF AAP><"" or EXECCOMM><"" or Immigration><"" or MgrMember><"" or OSHA><"" or StratPlan><"" or WageHour><"" or ERISA><"" or Health><"" or Litig><"" or OffHead><"" or PICCOMM><"" or Traditional><"" or WorkComp><"" then
BodyText=Replace(BodyText, "###SPECEmail###", "<b>Special E-mail Groups: </b>")
Please read this FAQ entry on MSDN:
An XML literal declaration is used in an expression in a location that
is ambiguous to the Visual Basic compiler. That is, the Visual Basic
compiler cannot determine whether the less-than character (<) is
intended as a comparative operator or the start of an XML literal.
You have a lot of < and > characters in your statement and that confuses the compiler.
Also: >< needs to be <> as explained in the comment by Andrew Morton.
So try changing your code to:
IF (AAP<>"") OR (EXECCOMM<>"") OR (Immigration<>"") OR (MgrMember<>"") OR (OSHA<>"") OR (StratPlan<>"") OR (WageHour<>"") OR (ERISA<>"") OR (Health<>"") OR (Litig<>"") OR (OffHead<>"") OR (PICCOMM<>"") OR (Traditional<>"") OR (WorkComp<>"") THEN
BodyText=Replace(BodyText, "###SPECEmail###", "<b>Special E-mail Groups: </b>")

How to check if a substring exists inside a 'Result' object with Robot Framework?

I am running the following test inside Robot Framework:
*** Settings ***
Documentation This initializes testrun.robot
Library Process
Library OperatingSystem
Library XML
Library Collections
Output Is A Valid XML File Against JATS format
Start Process xmllint --dtdvalid http://jats.nlm.nih.gov/archiving/1.1d3/JATS-archivearticle1.dtd ./output/nlm/out.xml shell=True
${result}= Wait For Process timeout=45 secs
Log ${result.stdout}
Log ${result.stderr}
Run Keyword Unless '${result.stderr} == ${EMPTY}' Should Contain ${result.stderr} element xref: validity error : IDREFS attribute rid references an unknown
The variable ${result.stderr} is a string that contains the substring 'element xref: validity error : IDREFS attribute rid references an unknown'. As far as I know, I'm not dealing with any whitespace errors or quotation problems, although I could be wrong. (I've been fiddling around with that for a while now.)
Thanks for the help!
Edit: The log that Robot Framework generates tells me that the process has finished (that's how I know what result.stderr contains.)
Consider this statement:
Run Keyword Unless '${result.stderr} == ${EMPTY}' ...
The keyword will never run because you aren't comparing two variables, you are simply checking whether the string literal string '${result.stderr} == ${EMPTY}' is not empty (and it's not, because it has 28 characters).
It is the same as if you did this in python:
if len('${result.stderr} == ${EMPTY}') > 0:
...
You need to put the single quotes around each variable separately so that you are passing a valid expression to the if statement, rather than a string that looks like a valid expression:
Run Keyword Unless '${result.stderr}' == '${EMPTY}' ...

Resources