Closed GoogleCodeExporter closed 8 years ago
It would be nice if you add the regExp ;)
BTW A better solution would be a CTMParser which returns the prefixes as result
of the parsing process.
Original comment by h.niederhausen@googlemail.com
on 15 Nov 2010 at 12:23
See http://isotopicmaps.org/ctm/ctm.html#prefix-directive:
[71] prefix-directive → '%prefix' identifier reference
[72] reference → iri
[5] iri → iri-undelimited | iri-delimited
[6] schema-name → [a-zA-Z]+ [a-zA-Z0-9+-.]*
[7] iri-undelimited →
schema-name '://' ([;.)]* [^#x20#x9#xD#xA;].()]+ ) +
[8] iri-delimited → '<' ([^<>"{}|^`\] '-' [#x00-#x20]) + '>'
[16] identifier → name-start ('.'* name-part)*
[15] name-part → name-start | [0-9] | '-' | '#x00B7' | [#x0300-#x036F] |
[#x203F-#x2040]
...
Try something like as a start. It's neither clean nor formally correct but it's
for a convenience method only...
/%prefix\s+(\w+)\s+(\S+)\r?\n
Original comment by bnjmn...@gmail.com
on 15 Nov 2010 at 12:38
Original comment by h.niederhausen@googlemail.com
on 15 Nov 2010 at 12:42
You may have a look at the semagia mio PrefixListener and/or
http://code.google.com/p/mio/source/browse/mio/trunk/mio-ctm/src/main/java/com/s
emagia/mio/ctm/CTMDeserializer.java
Original comment by bnjmn...@gmail.com
on 15 Nov 2010 at 12:44
This issue was closed by revision 8ce42575be.
Original comment by h.niederhausen@googlemail.com
on 18 Nov 2010 at 5:18
Original issue reported on code.google.com by
bnjmn...@gmail.com
on 15 Nov 2010 at 12:16