Questions tagged [xml-builder]

53 questions
17
votes
3 answers

Ruby on Rails: Using XML Builder Partials

Partials in XML builder are proving to be non-trivial. After some initial Google searching, I found the following to work, although it's not 100% xml.foo do xml.id(foo.id) xml.created_at(foo.created_at) …
randombits
  • 41,533
  • 69
  • 218
  • 394
12
votes
1 answer

NameError: uninitialized constant ActiveRecord::Associations::Builder::XMLMarkup

I found a post with a headline quite similar to this one, but it didn't give me the answer I was looking for. I am trying to use builder inside a model. The code looks something like this: require 'builder' class Document < ActiveRecord::Base ... …
klaffenboeck
  • 5,487
  • 3
  • 21
  • 33
7
votes
1 answer

Ruby XML Builder, how to create this namespace?

I'm using Ruby's XML Builder and trying to find the proper syntax to recreate the following RSS 2.0 declaration: What's the appropriate way of going about this with XML Builder to put…
randombits
  • 41,533
  • 69
  • 218
  • 394
7
votes
3 answers

Parse XML to JSON and back ... with xml2js and xmlbuilder?

Trying to parse XML into JSON with xml2js and then return the JSON to XML using xmlbuilder (usually after modifying the content programmatically). I think that the two should be complements, per this post…
prototype
  • 6,440
  • 12
  • 48
  • 86
5
votes
1 answer

Adding namspace in xml using a xmlbuilder in nodejs

I am generating xml in nodejs by using xmlbulilder package, now my requirement is to add namespace to xml. for example nodeText how we can…
Sachin
  • 109
  • 1
  • 8
4
votes
1 answer

Rails xml-builder custom namespace remove white space

I have a Google merchant centre XML script which is printing additional white space within every element and I can't seem to get rid of it I've simplified the script below to demonstrate what I'm after. Current script: xml.instruct! xml.feed…
moztech
  • 405
  • 2
  • 4
  • 14
4
votes
2 answers

What can I use to generate a local XML file?

I have a project that I am working on and I do not know much about Rails or Ruby. I need to generate an XML file from user input. Can some direct me to any resource that can show me how to do this pretty quickly and easily?
ironmantis7x
  • 799
  • 2
  • 14
  • 49
3
votes
2 answers

convert flat file records to xml in java

I have a scenario where records of employees written in flat file, something like : flatFile.txt ============ 1|name1|dept1|10000 2|name2|dept2|12000 3|name3|dept3|9500 .... .... Now I want to read this flat file and convert above employee records…
Nirmal
  • 4,739
  • 13
  • 70
  • 113
2
votes
1 answer

NodeJS checking if XML element exists and add or delete

I'm working with XML in NodeJS. I've been using the xmlbuilder to create my XML. The problem is that now I need to check if a element already exists and delete or update it. For example, I have the following XML
myTest532 myTest532
  • 1,451
  • 10
  • 24
2
votes
2 answers

Unable to create CDATA section in XML using "xmlbuilder" node.js module

I am using "xmlbuilder" node.js module to create xml file. I need to create a CDATA section as follows: I referred the github link, but didn't found any useful stuff. How to create such CDATA section…
2
votes
1 answer

How to import text file for xmlbuilder in node.js

I am using xmlbuilder npm package - which looks powerful , except I want to import an existing xml file into the xmlbuilder and manipulate elements / attributes etc as opposed to building the whole thing from scratch. It is possible to do it with…
Martin Thompson
  • 2,190
  • 4
  • 23
  • 48
1
vote
1 answer

Nested to_xml issue?

This may be a basic question but it has been causing me some problems. I am trying to dump an ActiveRecord Object to an XML file using the to_xml function. For whatever reason, this does not work for me if I try to nest it into an element. Basically…
Rhawb
  • 53
  • 1
  • 8
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,589
  • 6
  • 33
  • 42
1
vote
1 answer

layout for XML builder in rails 3

I would like to create general layout file for XML response. For example I would like to wrap those general part of RSS in the layout and leave the content be generated in the corresponding view file. For example, # in…
PeterWong
  • 15,743
  • 9
  • 57
  • 67
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
  • 111
  • 2
1
2 3 4