Skip to content

Attribute equals: `\' expected but `"' found #4

Closed
marcusatbang opened this Issue Jun 28, 2012 · 2 comments

2 participants

@marcusatbang

While using this to process some XML, the code:

val lines = xml $ "Wec_countryId[Wec_countryId=\""+id+"\"]"

Is throwing an exception:

java.lang.IllegalArgumentException: `\' expected but `"' found
    at se.fishtank.css.selectors.Selectors$EnrichedElem.cssQuery(Selectors.scala:19)
    at se.fishtank.css.selectors.Selectors$EnrichedElem.$(Selectors.scala:24)

The value of id in this case is 9c5bae60-4d6f-e111-afed-00155d6f0a00, so it isn't that value that's breaking it.

Thinking it might need escaping twice, I tried this:

val lines = sertxml $ "Wec_countryId[Wec_countryId=\\\""+id+"\\\"]"

But that threw this exception:

java.lang.IllegalArgumentException: string matching regex `[\x80-\xFF]' expected but `"' found
    at se.fishtank.css.selectors.Selectors$EnrichedElem.cssQuery(Selectors.scala:19)
    at se.fishtank.css.selectors.Selectors$EnrichedElem.$(Selectors.scala:24)
@chrsan
Owner
chrsan commented Jun 30, 2012

I'll check this as soon as I get back from vacation. Doesn't have access to a real computer right now.

@chrsan
Owner
chrsan commented Jul 7, 2012

There was a bug in the parsing when an attribute value was specified as a string. It should be fixed now in version 0.1.2 that's deployed to Maven Central. I've also added cross compilation for Scala 2.9.1 and 2.9.2. Plese check that this fix corrects your problem.

@chrsan chrsan closed this Jul 7, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.