Scala Mailing Lists | 21 May 2013 15:32
Picon
Picon
Favicon

Mailing list reminder: Scala-xml

Welcome to the "Scala-xml" mailing list.

This automatic reminder is sent once a month to the list,
to keep subscribers up-to-date with the mailing list services,
and to help keeping the list on topic.

-------------------------------------------------------------------

The "Scala-xml" mailing list:

This is the main interest list for coders interested in using
the XML manipulation capabilities of Scala.

Topics appropriate to this list include:

 * The Scala XML infrastructure, bugs, development
 * How to use the Scala XML features while writing code

Use this list to discuss any topic related to the Scala/XML
interoperability.

-------------------------------------------------------------------

Other information:

There are several Scala lists devoted to individual topics (and
more may be created in the future). For the full list, please
see: http://www.scala-lang.org/node/199

Try to avoid cross-posting whenever possible. If you can, select
(Continue reading)

Scala Mailing Lists | 21 Apr 2013 15:32
Picon
Picon
Favicon

Mailing list reminder: Scala-xml

Welcome to the "Scala-xml" mailing list.

This automatic reminder is sent once a month to the list,
to keep subscribers up-to-date with the mailing list services,
and to help keeping the list on topic.

-------------------------------------------------------------------

The "Scala-xml" mailing list:

This is the main interest list for coders interested in using
the XML manipulation capabilities of Scala.

Topics appropriate to this list include:

 * The Scala XML infrastructure, bugs, development
 * How to use the Scala XML features while writing code

Use this list to discuss any topic related to the Scala/XML
interoperability.

-------------------------------------------------------------------

Other information:

There are several Scala lists devoted to individual topics (and
more may be created in the future). For the full list, please
see: http://www.scala-lang.org/node/199

Try to avoid cross-posting whenever possible. If you can, select
(Continue reading)

Scala Mailing Lists | 21 Mar 2013 15:32
Picon
Picon
Favicon

Mailing list reminder: Scala-xml

Welcome to the "Scala-xml" mailing list.

This automatic reminder is sent once a month to the list,
to keep subscribers up-to-date with the mailing list services,
and to help keeping the list on topic.

-------------------------------------------------------------------

The "Scala-xml" mailing list:

This is the main interest list for coders interested in using
the XML manipulation capabilities of Scala.

Topics appropriate to this list include:

 * The Scala XML infrastructure, bugs, development
 * How to use the Scala XML features while writing code

Use this list to discuss any topic related to the Scala/XML
interoperability.

-------------------------------------------------------------------

Other information:

There are several Scala lists devoted to individual topics (and
more may be created in the future). For the full list, please
see: http://www.scala-lang.org/node/199

Try to avoid cross-posting whenever possible. If you can, select
(Continue reading)

Scala Mailing Lists | 21 Feb 2013 15:32
Picon
Picon
Favicon

Mailing list reminder: Scala-xml

Welcome to the "Scala-xml" mailing list.

This automatic reminder is sent once a month to the list,
to keep subscribers up-to-date with the mailing list services,
and to help keeping the list on topic.

-------------------------------------------------------------------

The "Scala-xml" mailing list:

This is the main interest list for coders interested in using
the XML manipulation capabilities of Scala.

Topics appropriate to this list include:

 * The Scala XML infrastructure, bugs, development
 * How to use the Scala XML features while writing code

Use this list to discuss any topic related to the Scala/XML
interoperability.

-------------------------------------------------------------------

Other information:

There are several Scala lists devoted to individual topics (and
more may be created in the future). For the full list, please
see: http://www.scala-lang.org/node/199

Try to avoid cross-posting whenever possible. If you can, select
(Continue reading)

workingDog | 7 Feb 2013 03:32
Picon

Preserving CDATA again

  Are there any plans to fix the CDATA issue in the next version of scala. 
  If so when can we expect to be able to preserve the CDATA.
  As I understand "other" libraries do it, so I suppose it could also be done in scala xml.
  I'm currently stuck, as I developed my code for the last 2 months using scala xml, 
  to find right at the end the CDATA show stopper. I'm so happy.

--
You received this message because you are subscribed to the Google Groups "scala-xml" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-xml+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Scala Mailing Lists | 21 Jan 2013 15:32
Picon
Picon
Favicon

Mailing list reminder: Scala-xml

Welcome to the "Scala-xml" mailing list.

This automatic reminder is sent once a month to the list,
to keep subscribers up-to-date with the mailing list services,
and to help keeping the list on topic.

-------------------------------------------------------------------

The "Scala-xml" mailing list:

This is the main interest list for coders interested in using
the XML manipulation capabilities of Scala.

Topics appropriate to this list include:

 * The Scala XML infrastructure, bugs, development
 * How to use the Scala XML features while writing code

Use this list to discuss any topic related to the Scala/XML
interoperability.

-------------------------------------------------------------------

Other information:

There are several Scala lists devoted to individual topics (and
more may be created in the future). For the full list, please
see: http://www.scala-lang.org/node/199

Try to avoid cross-posting whenever possible. If you can, select
the list that is closer to your topic and post in that list only.
In any case, never cross-post replies.

If you ever want to unsubscribe from this list, just visit this
page: http://groups.google.com/group/scala-xml/subscribe
or send an email to scala-xml+unsubscribe@...

Thank you!
The Scala Team

Eugene Yokota | 2 Jan 2013 03:29
Picon
Gravatar

Namespace binding (scope, xmlns) gets duplicated after subelement selection

Hi,


One of the scalaxb users recently reported that some scalaxb-generated code returns Node with xmlns attribute.
After digging in, I realized that the issue is coming from the XML library itself.

Here's a repro step:

Welcome to Scala version 2.10.0 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_33).
Type in expressions to have them evaluated.
Type :help for more information.

scala> <x:foo xmlns:x="http://foo.com/"><x:bar xmlns:x="http://bar.com/"><x:baz/></x:bar></x:foo>
res0: scala.xml.Elem = <x:foo xmlns:x="http://foo.com/"><x:bar xmlns:x="http://bar.com/"><x:baz/></x:bar></x:foo>

scala> (res0 \ "bar").head
res1: scala.xml.Node = <x:bar xmlns:x="http://bar.com/" xmlns:x="http://foo.com/"><x:baz/></x:bar>

scala> (res0 \ "bar").head.scope.getURI("x")
res2: String = http://bar.com/

In the above res1, namespace binding for prefix x is repeated twice. One for bar.com, and the other for foo.com, which came from the outer binding.
This is no longer a well-formed XML document.

Since the inner element's x binding overrides the outer binding, I think the output should be:

<x:bar xmlns:x="http://bar.com/"><x:baz/></x:bar>

I am guessing that the current implementation is simply appending the outer namespace binding(s).
So it's able to return the correct namespace for getURL("x").
Either at the time subelement selection is done using \ method or at the time of toString duplicate namespace binding should be weeded out.
This would probably incur quadratic cost, but given the likely small size of namespace bindings I think it's better to clean it up as early as possible.

For illustration purpose I used "x" as prefix, but more often than not the duplicated namespace binding would be for the default binding.

-eugene

Scala Mailing Lists | 21 Dec 2012 15:32
Picon
Picon
Favicon

Mailing list reminder: Scala-xml

Welcome to the "Scala-xml" mailing list.

This automatic reminder is sent once a month to the list,
to keep subscribers up-to-date with the mailing list services,
and to help keeping the list on topic.

-------------------------------------------------------------------

The "Scala-xml" mailing list:

This is the main interest list for coders interested in using
the XML manipulation capabilities of Scala.

Topics appropriate to this list include:

 * The Scala XML infrastructure, bugs, development
 * How to use the Scala XML features while writing code

Use this list to discuss any topic related to the Scala/XML
interoperability.

-------------------------------------------------------------------

Other information:

There are several Scala lists devoted to individual topics (and
more may be created in the future). For the full list, please
see: http://www.scala-lang.org/node/199

Try to avoid cross-posting whenever possible. If you can, select
the list that is closer to your topic and post in that list only.
In any case, never cross-post replies.

If you ever want to unsubscribe from this list, just visit this
page: http://groups.google.com/group/scala-xml/subscribe
or send an email to scala-xml+unsubscribe@...

Thank you!
The Scala Team

Luis Sanchis | 6 Dec 2012 16:48
Picon

Job Opportunity. Exciting fast growing start-up!

Hi there, 


This is InGo's Project Manager, Luis Sanchis. InGo is a start -up in the social media/event space.  We are eager to find motivated and qualified programers. 

We are looking for an experienced Scala/Lift developer to join our team and help us design/build our product. 


Required skills 

- Scala/Lift

- Mongo-DB  

- HTML5/CSS3/jQuery 

- DataBinder Dispatch

- SBT

- Github- Twitter/Facebook/Linkedin API (desirable)

- Selenium  (desirable)

-  Amazon AWS/EC2 &  nginx (desirable)

Look forward to building a great long term partnership.


Remote and part time work available!


Thanks!

Scala Mailing Lists | 21 Nov 2012 15:32
Picon
Picon
Favicon

Mailing list reminder: Scala-xml

Welcome to the "Scala-xml" mailing list.

This automatic reminder is sent once a month to the list,
to keep subscribers up-to-date with the mailing list services,
and to help keeping the list on topic.

-------------------------------------------------------------------

The "Scala-xml" mailing list:

This is the main interest list for coders interested in using
the XML manipulation capabilities of Scala.

Topics appropriate to this list include:

 * The Scala XML infrastructure, bugs, development
 * How to use the Scala XML features while writing code

Use this list to discuss any topic related to the Scala/XML
interoperability.

-------------------------------------------------------------------

Other information:

There are several Scala lists devoted to individual topics (and
more may be created in the future). For the full list, please
see: http://www.scala-lang.org/node/199

Try to avoid cross-posting whenever possible. If you can, select
the list that is closer to your topic and post in that list only.
In any case, never cross-post replies.

If you ever want to unsubscribe from this list, just visit this
page: http://groups.google.com/group/scala-xml/subscribe
or send an email to scala-xml+unsubscribe@...

Thank you!
The Scala Team

Evan Bennett | 9 Nov 2012 04:20
Picon

scala.xml.parsing.ConstructingParser.fromSource OutOfMemoryError

I am trying to write some code that will validate a String as valid XML and then convert it to some sort of XML object so that I can process the contents.

I have been trying to use the Scala XML classes (specifically scala.xml.XML.loadString(...)), but this appears to not necessarily provide the full input string when using the toString method as it removes comments and converts CDATA sections to text. Research on the Internet suggested using scala.xml.parsing.ConstructingParser.fromSource(...) (or using an XML library: Anti-XML; Scales Xml; a java XML library).

I chose to use the ConstructingParser as it seemed simplest. It works fine when I provide a valid XML string. When I provide an invalid XML string (in this case I have inserted random text as an attribute without a value), I except an Exception to be thrown, but it displays a message informing me of the invalid content and then processes for a while resulting in a 'java.lang.OutOfMemoryError: Java heap space' error.

I cannot find anything in the documentation informing me that I must pass valid XML to this method, and I have not found any method to just validate the XML String.  Please let me know if I have missed something.

I am developing code that will not be deployed for a while, so I have been using Scala 2.10, developing in Eclipse Juno, with Scala IDE Milestones for 2.10 (2.1.0.m2-2_10-201210191132-2563545 (which uses SBT 0.13.0.SNAPSHOT-2_10-20121019-1331)) and Scala Worksheet Nightly Updates for Scala IDE 2.1 and Scala 2.10 (0.2.0.nightly-2_10-201211070431-be42feb). I start Eclipse with '-vmargs -Xss8m -Xms700m -Xmx2048m'.

I have also download Scala 2.10.0-RC1 and Scala 2.9.2, and run the code through the command line interpreter, with the same results.

This seems to me to be similar to an existing Scala Issue: OutOfMemoryErrors and inifinte loops in scala.xml.parsing.ConstructingParser - https://issues.scala-lang.org/browse/SI-4520

I have considered using Anti-XML, but have not found anywhere that tells me how to use it with Scala 2.10. (I have not looked very hard or tried anything myself, as I found the ConstructingParser.)

I have attached a Scala Worksheet file (temp.sc.txt as I could not upload with the .sc extension) with my test code, and text file with the command line interpreter session for Scala 2.10.0-RC1. If I remove 'strtdohso ' from the XML String everything works.

Any advice on what I should do would be greatly appreciated. e.g. What I am doing wrong; How to validate the XML before using ConstructingParser; Whether to submit a bug report; etc.

Thanks,
  Evan Bennett
object temp {
  val xmlString = """<foo><!--      Comment --><bar strtdohso attr="test"><![CDATA[a > b]]></bar><bar>b</bar><bar>c</bar></foo>"""

  val xmlSource = scala.io.Source.fromString(xmlString)

  val xmlParser = scala.xml.parsing.ConstructingParser.fromSource(xmlSource, true)

  val xmlDocument = xmlParser.document

  val xmlToString = xmlDocument.toString

  xmlString == xmlToString

  println(xmlToString)
}
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\development\scala-2.10.0-RC1\bin>scala
Welcome to Scala version 2.10.0-RC1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7
.0_09).
Type in expressions to have them evaluated.
Type :help for more information.

scala> val xmlString = """<foo><!--      Comment --><bar strtdohso attr="test"><
![CDATA[a > b]]></bar><bar>b</bar><bar>c</bar></foo>"""
xmlString: String = <foo><!--      Comment --><bar strtdohso attr="test"><![CDAT
A[a > b]]></bar><bar>b</bar><bar>c</bar></foo>

scala> val xmlSource = scala.io.Source.fromString(xmlString)
xmlSource: scala.io.Source = non-empty iterator

scala> val xmlParser = scala.xml.parsing.ConstructingParser.fromSource(xmlSource
, true)
xmlParser: scala.xml.parsing.ConstructingParser = scala.xml.parsing.Constructing
Parser <at> 59c81460

scala> val xmlDocument = xmlParser.document
:1:42: '=' expected instead of 'a'ttr="test"><![CDATA[a > b]]></bar><bar>b</bar>
<bar>c</bar></foo>                                         ^
java.lang.OutOfMemoryError: Java heap space
        at java.util.Arrays.copyOf(Unknown Source)
        at java.lang.AbstractStringBuilder.expandCapacity(Unknown Source)
        at java.lang.AbstractStringBuilder.ensureCapacityInternal(Unknown Source
)
        at java.lang.AbstractStringBuilder.append(Unknown Source)
        at java.lang.StringBuilder.append(Unknown Source)
        at scala.collection.mutable.StringBuilder.append(StringBuilder.scala:264
)
        at scala.xml.parsing.MarkupParserCommon$class.xAttributeValue(MarkupPars
erCommon.scala:66)
        at scala.xml.parsing.ConstructingParser.xAttributeValue(ConstructingPars
er.scala:47)
        at scala.xml.parsing.MarkupParserCommon$class.xAttributeValue(MarkupPars
erCommon.scala:74)
        at scala.xml.parsing.ConstructingParser.xAttributeValue(ConstructingPars
er.scala:47)
        at scala.xml.parsing.MarkupParser$class.xAttributes(MarkupParser.scala:3
10)
        at scala.xml.parsing.ConstructingParser.xAttributes(ConstructingParser.s
cala:47)
        at scala.xml.parsing.MarkupParser$class.mkAttributes(MarkupParser.scala:
282)
        at scala.xml.parsing.ConstructingParser.mkAttributes(ConstructingParser.
scala:47)
        at scala.xml.parsing.ConstructingParser.mkAttributes(ConstructingParser.
scala:47)
        at scala.xml.parsing.MarkupParserCommon$class.xTag(MarkupParserCommon.sc
ala:44)
        at scala.xml.parsing.ConstructingParser.xTag(ConstructingParser.scala:47
)
        at scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:553)

        at scala.xml.parsing.ConstructingParser.element1(ConstructingParser.scal
a:47)
        at scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:418)

        at scala.xml.parsing.ConstructingParser.content1(ConstructingParser.scal
a:47)
        at scala.xml.parsing.MarkupParser$class.content(MarkupParser.scala:442)
        at scala.xml.parsing.ConstructingParser.content(ConstructingParser.scala
:47)
        at scala.xml.parsing.MarkupParser$class.element1(MarkupParser.scala:567)

        at scala.xml.parsing.ConstructingParser.element1(ConstructingParser.scal
a:47)
        at scala.xml.parsing.MarkupParser$class.content1(MarkupParser.scala:418)

        at scala.xml.parsing.ConstructingParser.content1(ConstructingParser.scal
a:47)
        at scala.xml.parsing.MarkupParser$class.document(MarkupParser.scala:239)

        at scala.xml.parsing.ConstructingParser.document(ConstructingParser.scal
a:47)
        at .<init>(<console>:10)
        at .<clinit>(<console>)
        at .<init>(<console>:7)

scala>
C:\development\scala-2.10.0-RC1\bin>

Gmane