Comments (2)
That's what I'm doing right now. I put it to concatenate the received data.
I created a function responsible for this process.
Since this behavior is to be expected, I'll keep the function then!
Follow the example of the implementation because it can be useful for someone.
{:ok, update_node(state, :neighborhood_name, content)}
def update_node(state, field, content) when is_binary(content) do
current_value = state.node |> Map.get(field) |> to_string()
trimmed_content = String.trim(content)
updated_node = Map.put(state.node, field, current_value <> trimmed_content)
%{state | node: updated_node}
end
def update_node(state, field, content) do
updated_node = Map.put(state.node, field, content)
%{state | node: updated_node}
end
Thanks!
from saxy.
Hi, there is no guarantee that there will be only 1 :characters
event per element. It's the expected behavior to emit these :characters
events. One could concatenate them to get the full strings of all the characters though.
from saxy.
Related Issues (20)
- "UTF-8" vs "utf-8" in the encoded prolog? HOT 4
- Documenting how to filter out newlines from the parsed model HOT 2
- Can we safely raise an error from a handler? HOT 2
- Saxy.encode! function is not escaping characters in some cases
- Is streaming encoding possible with Saxy? HOT 6
- Closing the event stream - detect end_document
- `Saxy.XML.element/3` and a non-list third argument results in a Dialyzer error HOT 1
- Namespace support HOT 3
- Concerns on whitespace emitting and parsing HOT 3
- Example of pretty-printing (indenting) XML with Saxy?
- Cutting a new release? HOT 2
- Stream fails to parse if XML file contains a leading BOM character HOT 1
- Saxy does not map \r to \n like SimpleXml does - can we count on this continuing? HOT 2
- CDATA element fails to parse when element contains £ symbol HOT 6
- Saxy does parse but does not encode properly HOT 1
- Special characters are not escaped during xml encoding HOT 1
- Tolerate ASCII encoding instead of UTF-8 HOT 2
- XML element name parsing is not spec compliant
- Returning incorrect result in `handle_event` results in silent error HOT 1
- Have you considered implementing a declarative syntax for parsing? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from saxy.