Questions tagged [xml-builder]

62 questions
1
vote
1 answer

Loop in nodejs xmlbuilder

How can I loop through and choose some data from the array? I try to manage it, but inside the loop the xmlbuilder did not define the expected result. To choose the right value maybe it is easy just I have to define the exact element but not yet…
Denes
  • 111
  • 7
1
vote
1 answer

Adding a XML root attribute with hyphens in python XMLBuilder

I'm integrating with the google checkout api and all of their attributes include hyphens in their attribute values. So to create a request to charge an order I need to send an xml post that looks like:
whatWhat
  • 3,987
  • 7
  • 37
  • 44
1
vote
0 answers

using createWriteStream with xmlbuilder consume a lot of ram

We need to create a XML file with some items in there, so we are using xmlbuilder module for this. The array have 50k of products, the memory usage processing the file is 200mb of ram, but at the moment of creating the file with xmlbuilder, the…
1
vote
1 answer

XMLBuilder adds the attributes to wrong node in the XML file

I am creating the XML files in Node.js using the XMLBuilder package. Everything is working fine except for one thing. I am trying to add attributes to root element but for some reason, it gets added to child element. I have declared my root element…
BATMAN_2008
  • 2,788
  • 3
  • 31
  • 98
1
vote
0 answers

xml namespace issues when building an xml file in nodejs xmlbuilder2

When I include this line in my template for nodejs xmlbuilder2: template = { 'jcr:root': { ... '@xmlns:jcr': 'http://www.jcp.org/jcr/1.0', // this one ... } } I get the following error. NamespaceError: The operation is not allowed…
Kenzie
  • 131
  • 1
  • 3
1
vote
1 answer

Node.js XML builder Error: Invalid character in name: during creation of XML document

I am trying to create the XML file using the node.js and npm package xmlbuilder. When I am trying to create the tags I have some special characters such as : / etc due to which I am getting the following error: Error: Invalid character in name:…
BATMAN_2008
  • 2,788
  • 3
  • 31
  • 98
1
vote
2 answers

Problem in printing angle brackets using the xml-builder node module

I am creating an xml file using "xml-builder" node module. But when I tried to write angle brackets ("<" or ">"), I got characters like "<" and ">". The code is as follows: let builder = require('xmlbuilder', { encoding: 'utf-8' }); let name =…
1
vote
0 answers

How to replace or remove XML HEADER while using xmlbuilder-js of NodeJs?

I am using NodeJs library called xmlbuilder-js for building dynamic XML output but I'm having a little difficulty removing the header of the XML Output. Following is my code sample var xml = builder.create('root') .ele('parent') …
Point Networks
  • 1,071
  • 1
  • 13
  • 35
1
vote
0 answers

How to write Rails Builder XML start and end tags without 'do'

I have a Staff model as follows (for brevity) id firstname lastname stafftype (e.g. Chef, Driver, Team Leader) I also have a StaffTimePeriod model as follows id staffid date staffstatus (e.g. Working, Holiday, Sick) There is a…
nexar
  • 11,126
  • 3
  • 29
  • 32
1
vote
0 answers

rails builder xml: I'm changing namespace but the injected value is removed?

So I have an xml doc being generated based on product info in rails (using the builder markup (http://builder.rubyforge.org/classes/Builder/XmlMarkup.html), but when I use builders namespace syntax, the value I want to print is absent. Here's the…
Grant Leslie
  • 41
  • 1
  • 7
1
vote
1 answer

ruby on rails xml builder question

Anybody know how to produce an xml element like this in rails using xml Builder? http://example.com/image.jpg xml.image :loc http://example.com/image.jpg Is supposed to work but doesn't.
concept47
  • 30,257
  • 12
  • 52
  • 74
1
vote
2 answers

rails xml.builder missing template error

Error: Template is missing Missing template miscellaneous/sitemap, application/sitemap with {:locale=>[:en], :formats=>[:xml], :handlers=>[:erb, :builder]}. Searched in: * "/Users/yliu/Google Drive/ruby projects/Blog/lenswish/app/views" *…
Tristan.Liu
  • 176
  • 1
  • 7
1
vote
2 answers

Rails xml builder link with custom tag

I am creating a data.xml.builder file that I will feed into javascript library to create a table. A short excerpt is the following xml.tag!("row",{"id" => item.id}) do xml.tag!("cell", item.name) end I would like the item.name to also be a…
capcode01
  • 163
  • 1
  • 15
1
vote
1 answer

Generate multiple XML files based on database

Can someone provide an example of using Builder to create multiple XML files from a SQL database. I can easily create one containing the entire database as in here... def index respond_to do |format| format.xml { @rides = Rides.find(:all) } …
Pat R
  • 186
  • 4
  • 15
0
votes
0 answers

how to convert json object to xml with every property of tag in new line

I am using xmlbuilder2 to searilize JSON Object const newXml = convert(doc, { format: 'xml', headless: true, prettyPrint: true, newline: ' ', }); I want to pretty print XML with whitespace so that each tag appears on a…
Bhupendra
  • 1,196
  • 16
  • 39