Closed sonofmun closed 8 years ago
This one is gonna be painful.
@balmas Would you like me to get this or would you think someone else (including you) should do it ?
From what I can see, I'd tend to agree with you. And for what it can do... Well, it can basically destroy the CTS API :D
The problem seems to be that these regexes are only set up to deal with one @. What would happen if this
"^(.*?)(@[\w\d\._:\s]+)=[""']\?[""'](.*)$"
were changed to this
"^(.*?)((@[\w\d\._:\s]+)=[""']\?[""']\s?)+(.*)$"
or perhaps to this
"^(.*?)(?:(@[\w\d\._:\s]+)=[""']\?[""']\s?)+(.*)$"
I am not sure if the following would still work as planned, however:
fn:concat("$1", "$2", $startRange, " and ", "$2", $endRange, "$3")
You're right, if $startrange /$endRange is what we think, we might get into troubles here, We would then need to make sure this comes in $3 ?
$startrange /$endRange are not part of the regex, but are calculated here. I don't really understand how. But I would think that changing the regex should not affect either of them. Or am I completely wrong here?
Having a look at https://regex101.com/r/eE5dI3/1
It seems this might not be the good place to look at !
Do you have any line number when the error occurs ?
That's a cool regex testing tool... I was just about to say that I think the regex should work as long as there is only one attribute in the xpath template which is set to ='?'
regexpal is generally my best ... pal in this kind of situation...
<position>l 733, c 5</position>
But that is the location of the error message that it throws.
Can you print the inventory part of the CTS API for the text ? If required, check that there is no cache in the database for this precise file
Would that be the results of this
http://localhost:8080/exist/restxq/cts?request=GetPassage&inv=latin&urn=urn:cts:latinLit:stoa0040.stoa029.opp-lat1
i.e., no specific passage but the whole work?
Try : http://localhost:8080/exist/restxq/cts?request=GetCapabilities&inv=latin&urn=urn:cts:latinLit:stoa0040.stoa029.opp-lat1 or just find the specific passage removing the urn
The GetCapabilities call returns this for citationMapping
<ti:citationMapping>
<ti:citation label="section" xpath="/tei:div[@n='?'" scope="/tei:TEI/tei:text/tei:body/tei:div[@type='edition']"/>
</ti:citationMapping>
But the Inventory Maker page shows this
<ti:citationMapping>
<ti:citation label="section" xpath="/tei:div[@n='?' and @subtype='section']" scope="/tei:TEI/tei:text/tei:body/tei:div[@type='edition']"/>
</ti:citationMapping>
I am pretty sure that I cleared my cache correctly (Chrome: More Tools>Clear Browsing Data... and cleared all cached images and files from the past day). So is this a cache problem or a CTS API problem? Or do you need more information than just that?
Should we have a small hangout ?
The peer coding starts in 15 minutes, right?
Yup but probably lets debug this situation quickly before ?
This issue was caused by user error. There doesn't actually seem to be a problem. Closing now.
See https://github.com/Capitains/inventory-maker/issues/13
The problem in Inventory Maker is fixed. Now
produces in the inventory
Now the problem seems to be with the CTS API. When I do the following
I get the following error in CTS 5 API XQ