[Lift] Re: Problem with Menu.builder li_path/li_item
attribute with the same name but different prefixes should be ok as long as the prefixes are bound to namespace URL's. Br's, Marius On Jun 3, 12:24 am, Derek Chen-Becker dchenbec...@gmail.com wrote: I think that this has been discussed on the list before. It's definitely an issue with having the same attribute name with different prefixes. I don't know that using proper namespace declarations will fix it. It seems that this is a bug in the Scala XML parser. Derek On Tue, Jun 2, 2009 at 2:55 PM, Jeppe Nejsum Madsen je...@ingolfs.dkwrote: On 2 Jun 2009, David Pollak wrote: This is an XML parsing error. Something in your XML is non-parsable. It's not Lift, but the underlying XML parsing library. Yes, it would seem so. It looks like a bug/non-implemented feature that the parser is unable to read two attributes with the same name but in different name spaces. Not sure if this is because the fragment doesn't contain any name space decls? Unfortunately this renders the Menu.builder less useful since it is not possible to assign CSS classes to both the path items and the selected item (which, imho, is an obvious use case). Being a Lift newbie, I'm wondering if there are other parts of Lift that is influenced by this. Here's a very small test case that illustrates the problem: Given this program: import _root_.net.liftweb.util._ import _root_.java.io._ object ReadXML extends Application { val xml= PCDataXmlParser(new FileInputStream(test.xml)) } This XML fragment fails to parse: lift:surround with=base at=body lift:Menu.builder li_path:class=p li_item:class=i/ /lift:surround But this parses ok (note the slight change in attribute names): lift:surround with=base at=body lift:Menu.builder li_path:class=p li_item:clasz=i/ /lift:surround Accidentally, I think there's a problem with the error reporting when parsing fails. Looking at the code to scala.io.Source, the original exception is a double attribute syntax error, but due to what I think is a bug in Source.getLine, I always get errors reported as java.lang.IllegalArgumentException: line 1 does not exist Am I the only one seeing this? /Jeppe --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Problem with Menu.builder li_path/li_item
On 3 Jun 2009, marius d. wrote: attribute with the same name but different prefixes should be ok as long as the prefixes are bound to namespace URL's. But the problem here is that the attributes are in an inner template, which, I presume, will be read before the outer template (with the namespace URLs). Parsing the inner template fails as shown previously. On a conceptual level I don't think the li_path, li_item namespaces should be declared in the resulting page produced by lift. It is used solely by Lift for the rendering. But it seems these kind of prefixes in xml fragments are not supported by the Scala XML parser. /Jeppe --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Problem with Menu.builder li_path/li_item
This is a bug in the Scala XML parser... I'll fix (work around) the bug today. On Wed, Jun 3, 2009 at 7:20 AM, Jeppe Nejsum Madsen je...@ingolfs.dkwrote: On 3 Jun 2009, marius d. wrote: attribute with the same name but different prefixes should be ok as long as the prefixes are bound to namespace URL's. But the problem here is that the attributes are in an inner template, which, I presume, will be read before the outer template (with the namespace URLs). Parsing the inner template fails as shown previously. On a conceptual level I don't think the li_path, li_item namespaces should be declared in the resulting page produced by lift. It is used solely by Lift for the rendering. But it seems these kind of prefixes in xml fragments are not supported by the Scala XML parser. /Jeppe -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Problem with Menu.builder li_path/li_item
On 3 Jun 2009, David Pollak wrote: I've pushed up a fix Excellent, thanks! When I finally figured out how to use the li_* attributes I thought it was a very nice way to make the snippets configurable. Great was the dismay when I found it didn't work :-( /Jeppe --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Problem with Menu.builder li_path/li_item
Please post the exception On Tue, Jun 2, 2009 at 7:47 AM, Jeppe Nejsum Madsen je...@ingolfs.dkwrote: Running 1.1-SNAPSHOT, the following construct lift:Menu.builder li_path:class=pathclass li_item:class=itemclass/ Seems to results in an exception when Lift processes the template. The error seems related to the fact that both li_path li_item tries to set the class. If I change one to e.g. li_path:style, everything works. Is this a bug or is there a good reason why the above shouldn't be allowed? /Jeppe -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Problem with Menu.builder li_path/li_item
On 2 Jun 2009, David Pollak wrote: Please post the exception The code is just the basic archetype with the above template changes and a new menu item as child of Home to show the path style. No exception on the console, but I get this in the browser: Exception occured while processing / Message: java.lang.IllegalArgumentException: line 61 does not exist scala.io.Source.getLine(Source.scala:280) scala.io.Source.report(Source.scala:368) scala.io.Source.reportError(Source.scala:355) scala.io.Source.reportError(Source.scala:344) scala.xml.parsing.MarkupParser$class.reportSyntaxError(MarkupParser.scala:1113) net.liftweb.util.PCDataXmlParser.reportSyntaxError(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.reportSyntaxError(MarkupParser.scala:1117) net.liftweb.util.PCDataXmlParser.reportSyntaxError(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.xAttributes(MarkupParser.scala:311) net.liftweb.util.PCDataXmlParser.xAttributes(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.xTag(MarkupParser.scala:365) net.liftweb.util.PCDataXmlParser.xTag(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:667) net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:481) net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.content(MarkupParser.scala:505) net.liftweb.util.PCDataXmlParser.content(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:682) net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:481) net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.content(MarkupParser.scala:505) net.liftweb.util.PCDataXmlParser.content(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:682) net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:481) net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.content(MarkupParser.scala:505) net.liftweb.util.PCDataXmlParser.content(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:682) net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:481) net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.content(MarkupParser.scala:505) net.liftweb.util.PCDataXmlParser.content(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:682) net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:481) net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.document(MarkupParser.scala:206) net.liftweb.util.PCDataXmlParser.document(PCDataMarkupParser.scala:91) net.liftweb.util.PCDataXmlParser$.apply(PCDataMarkupParser.scala:102) net.liftweb.http.TemplateFinder$.findAnyTemplate(LiftSession.scala:1194) net.liftweb.http.LiftSession.findTemplate(LiftSession.scala:712) net.liftweb.http.LiftSession.findAndMerge(LiftSession.scala:1068) net.liftweb.builtin.snippet.Surround$$anonfun$render$1$$anonfun$apply$2.apply(Surround.scala:36) net.liftweb.builtin.snippet.Surround$$anonfun$render$1$$anonfun$apply$2.apply(Surround.scala:31) net.liftweb.util.Full.map(Box.scala:330) net.liftweb.builtin.snippet.Surround$$anonfun$render$1.apply(Surround.scala:31) net.liftweb.builtin.snippet.Surround$$anonfun$render$1.apply(Surround.scala:30) net.liftweb.util.Full.flatMap(Box.scala:332) net.liftweb.builtin.snippet.Surround$.render(Surround.scala:30) net.liftweb.builtin.snippet.Surround$$anonfun$dispatch$1$$anonfun$apply$1.apply(Surround.scala:26) net.liftweb.builtin.snippet.Surround$$anonfun$dispatch$1$$anonfun$apply$1.apply(Surround.scala:26) net.liftweb.http.LiftSession$$anonfun$17$$anonfun$apply$47$$anonfun$apply$50$$anonfun$apply$52.apply(LiftSession.scala:843) net.liftweb.http.LiftSession$$anonfun$17$$anonfun$apply$47$$anonfun$apply$50$$anonfun$apply$52.apply(LiftSession.scala:830) net.liftweb.util.EmptyBox.openOr(Box.scala:372)
[Lift] Re: Problem with Menu.builder li_path/li_item
This is an XML parsing error. Something in your XML is non-parsable. It's not Lift, but the underlying XML parsing library. On Tue, Jun 2, 2009 at 8:14 AM, Jeppe Nejsum Madsen je...@ingolfs.dkwrote: On 2 Jun 2009, David Pollak wrote: Please post the exception The code is just the basic archetype with the above template changes and a new menu item as child of Home to show the path style. No exception on the console, but I get this in the browser: Exception occured while processing / Message: java.lang.IllegalArgumentException: line 61 does not exist scala.io.Source.getLine(Source.scala:280) scala.io.Source.report(Source.scala:368) scala.io.Source.reportError(Source.scala:355) scala.io.Source.reportError(Source.scala:344) scala.xml.parsing.MarkupParser$class.reportSyntaxError(MarkupParser.scala:1113) net.liftweb.util.PCDataXmlParser.reportSyntaxError(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.reportSyntaxError(MarkupParser.scala:1117) net.liftweb.util.PCDataXmlParser.reportSyntaxError(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.xAttributes(MarkupParser.scala:311) net.liftweb.util.PCDataXmlParser.xAttributes(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.xTag(MarkupParser.scala:365) net.liftweb.util.PCDataXmlParser.xTag(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:667) net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:481) net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.content(MarkupParser.scala:505) net.liftweb.util.PCDataXmlParser.content(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:682) net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:481) net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.content(MarkupParser.scala:505) net.liftweb.util.PCDataXmlParser.content(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:682) net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:481) net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.content(MarkupParser.scala:505) net.liftweb.util.PCDataXmlParser.content(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:682) net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:481) net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.content(MarkupParser.scala:505) net.liftweb.util.PCDataXmlParser.content(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:682) net.liftweb.util.PCDataXmlParser.element1(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:481) net.liftweb.util.PCDataXmlParser.content1(PCDataMarkupParser.scala:91) scala.xml.parsing.MarkupParser$class.document(MarkupParser.scala:206) net.liftweb.util.PCDataXmlParser.document(PCDataMarkupParser.scala:91) net.liftweb.util.PCDataXmlParser$.apply(PCDataMarkupParser.scala:102) net.liftweb.http.TemplateFinder$.findAnyTemplate(LiftSession.scala:1194) net.liftweb.http.LiftSession.findTemplate(LiftSession.scala:712) net.liftweb.http.LiftSession.findAndMerge(LiftSession.scala:1068) net.liftweb.builtin.snippet.Surround$$anonfun$render$1$$anonfun$apply$2.apply(Surround.scala:36) net.liftweb.builtin.snippet.Surround$$anonfun$render$1$$anonfun$apply$2.apply(Surround.scala:31) net.liftweb.util.Full.map(Box.scala:330) net.liftweb.builtin.snippet.Surround$$anonfun$render$1.apply(Surround.scala:31) net.liftweb.builtin.snippet.Surround$$anonfun$render$1.apply(Surround.scala:30) net.liftweb.util.Full.flatMap(Box.scala:332) net.liftweb.builtin.snippet.Surround$.render(Surround.scala:30) net.liftweb.builtin.snippet.Surround$$anonfun$dispatch$1$$anonfun$apply$1.apply(Surround.scala:26) net.liftweb.builtin.snippet.Surround$$anonfun$dispatch$1$$anonfun$apply$1.apply(Surround.scala:26) net.liftweb.http.LiftSession$$anonfun$17$$anonfun$apply$47$$anonfun$apply$50$$anonfun$apply$52.apply(LiftSession.scala:843) net.liftweb.http.LiftSession$$anonfun$17$$anonfun$apply$47$$anonfun$apply$50$$anonfun$apply$52.apply(LiftSession.scala:830)
[Lift] Re: Problem with Menu.builder li_path/li_item
On 2 Jun 2009, David Pollak wrote: This is an XML parsing error. Something in your XML is non-parsable. It's not Lift, but the underlying XML parsing library. Yes, it would seem so. It looks like a bug/non-implemented feature that the parser is unable to read two attributes with the same name but in different name spaces. Not sure if this is because the fragment doesn't contain any name space decls? Unfortunately this renders the Menu.builder less useful since it is not possible to assign CSS classes to both the path items and the selected item (which, imho, is an obvious use case). Being a Lift newbie, I'm wondering if there are other parts of Lift that is influenced by this. Here's a very small test case that illustrates the problem: Given this program: import _root_.net.liftweb.util._ import _root_.java.io._ object ReadXML extends Application { val xml= PCDataXmlParser(new FileInputStream(test.xml)) } This XML fragment fails to parse: lift:surround with=base at=body lift:Menu.builder li_path:class=p li_item:class=i/ /lift:surround But this parses ok (note the slight change in attribute names): lift:surround with=base at=body lift:Menu.builder li_path:class=p li_item:clasz=i/ /lift:surround Accidentally, I think there's a problem with the error reporting when parsing fails. Looking at the code to scala.io.Source, the original exception is a double attribute syntax error, but due to what I think is a bug in Source.getLine, I always get errors reported as java.lang.IllegalArgumentException: line 1 does not exist Am I the only one seeing this? /Jeppe --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Problem with Menu.builder li_path/li_item
I think that this has been discussed on the list before. It's definitely an issue with having the same attribute name with different prefixes. I don't know that using proper namespace declarations will fix it. It seems that this is a bug in the Scala XML parser. Derek On Tue, Jun 2, 2009 at 2:55 PM, Jeppe Nejsum Madsen je...@ingolfs.dkwrote: On 2 Jun 2009, David Pollak wrote: This is an XML parsing error. Something in your XML is non-parsable. It's not Lift, but the underlying XML parsing library. Yes, it would seem so. It looks like a bug/non-implemented feature that the parser is unable to read two attributes with the same name but in different name spaces. Not sure if this is because the fragment doesn't contain any name space decls? Unfortunately this renders the Menu.builder less useful since it is not possible to assign CSS classes to both the path items and the selected item (which, imho, is an obvious use case). Being a Lift newbie, I'm wondering if there are other parts of Lift that is influenced by this. Here's a very small test case that illustrates the problem: Given this program: import _root_.net.liftweb.util._ import _root_.java.io._ object ReadXML extends Application { val xml= PCDataXmlParser(new FileInputStream(test.xml)) } This XML fragment fails to parse: lift:surround with=base at=body lift:Menu.builder li_path:class=p li_item:class=i/ /lift:surround But this parses ok (note the slight change in attribute names): lift:surround with=base at=body lift:Menu.builder li_path:class=p li_item:clasz=i/ /lift:surround Accidentally, I think there's a problem with the error reporting when parsing fails. Looking at the code to scala.io.Source, the original exception is a double attribute syntax error, but due to what I think is a bug in Source.getLine, I always get errors reported as java.lang.IllegalArgumentException: line 1 does not exist Am I the only one seeing this? /Jeppe --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---