|
|
|
|
|
|
Re: [TCS] ei.unescapeString(getText(), 1) [message #25706 is a reply to message #25677] |
Sat, 10 January 2009 17:45 |
J Rusk Messages: 16 Registered: July 2009 |
Junior Member |
|
|
Thanks. This was working for me just great - until I realized with an
example that the different syntaxes ("string", _"string", or just string)
can show up within the same attribute, please see example below:
importsOntology { GML#GML212Ontology, FilterEncoding#FilterEncoding,
_http://www.swing-project.org/virtual }
My basic problem is that any IRI can be abbreviated to a Compact URI. Full
IRI's are delimited with the symbols ' _" ' and ' " ' but Compact URI does
not require special delimiters.
I'm not sure where to go from here. Any thoughts?
Andy Carpenter wrote:
> Jeff,
> The way that I'd handle this is by making the model
> reflect more syntax than ideal by having an attribute
> for each of the possible types. I'd then do an m2m
> transformation to convert the 'syntactic' model into
> a 'purer' form.
> Andy.
> "J Rusk" <rusk@qiniq.com> wrote in message
> news:cc1870b08f6247196a9c1a7403770c72$1@www.eclipse.org...
>> Thanks Andy. Very good point. I likely was heading in the wrong
>> direction.
>>
>> Would this work in situations where I do not know in advance which
>> primitiveTemplate would be required for a given attribute (i.e. could be
>> "string" or _"string" for a given attribute)?
>>
>> Jeff
>>
>> Andy Carpenter wrote:
>>
>>> I can't tell you how the ei.unescapeString() function
>>> works, but I don't think that you're trying to take the
>>> correct approach.
>>
>>> As you have two different primitives, I think that you
>>> need to declare two string primitiveTemplates. One of
>>> these should be defined with the default keyword,
>>> and will be called for most string type attributes in
>>> your grammar. For string type attributes that need the
>>> other syntax, use the "{as=xxx}" annotation on the
>>> attribute name; where xxx is the name of your
>>> non-default string primitiveTemplate.
>>
>>> I hope that this helps
>>
>>> Andy.
>>
>>
>>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03903 seconds