59 questions
0
votes
0
answers
25
views
Error 394 when generating XML in Node.js with xmlbuilder2
I am encountering error 394 when trying to submit the NFC-e to SEFAZ. The error message indicates that the invoice is being rejected due to "missing QR-Code information." However, when ...
2
votes
2
answers
65
views
How to make a method returning XMLError compatible with anyhow::Error?
This is my code (XMLElement from xml-builder):
use anyhow::Result;
use xml_builder::XMLElement;
fn foo() -> Result<()> {
let mut v = XMLElement::new("v");
v.add_child(XMLElement:...
0
votes
1
answer
70
views
Add new xml nodes dynamically with N number of nested tags
I have the below sample xml.
<A>
<B>[email protected]</B>
</A>
And I want to insert a new set of xml message tags dynamically using groovy as the below 2 samples. ...
0
votes
1
answer
369
views
How to Insert xml nodes in a CData section when creating a xml document with xmlbuilder2
I'm having trouble creating a XML document with a CDATA section. Given this code:
const xmlObj = {
"s:Envelope": {
'@xmlns:s': http://schemas.xmlsoap.org/soap/envelope/",
...
1
vote
1
answer
891
views
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 ...
0
votes
0
answers
423
views
xmlbuilder2 and NodeJS/ExpressJS
I have a requirement to provide an endpoint that generates a sitemap.
This endpoint uses 'xmlbuilder2' and the goal is to return pure XML that can be delivered to the browser.
@Get()
public ...
0
votes
1
answer
225
views
Create XML object with dynamical content from a source CSV file
I have the following CSV file:
iDocType,iDocId,iName,iDate
P,555551555,Braiden,2022-12-31
I,100000001,Dominique,2024-12-10
P,100000002,Joyce,2025-11-15
Using jmeter's JSR223 preprocessor element, I ...
1
vote
0
answers
244
views
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 ...
-1
votes
1
answer
247
views
Generate XML having repeated tags from JSON
I am using xmlBuilder library in Nodejs to create XML from prepared corresponding JSON.
I am creating JSON structure first and then convert it to XML. Javascript is the coding language.
It is required ...
2
votes
1
answer
792
views
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 ...
0
votes
1
answer
752
views
How to add a custom tag in xml using xmlbuilder package in node javascript
I am having a case where I want to add this tag in my xml just below the prolog something like this :
<?xml version="1.0"?>
<?AXOXMLMAP FILE=gnvouchr LIBRARY=. ;VOLUME=xmlmap?>
...
1
vote
1
answer
2k
views
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 ...
0
votes
1
answer
785
views
xml builder root is keeping the track of previous values and duplicates the results but unable to make it empty also
I tried searching the answer but as there a limited number of questions on XMLBUILDER could not find. Hence posting the question really sorry if found duplicate.
I am using the XMLBUILDER Node.js ...
0
votes
3
answers
500
views
Efficient way to calculate if the fields are populated using the if condition in javascript when the field list is very large
I have a form which has lot of fields consider maybe 100. All of the fields are different such as it could be StartTime DateTime EndTime Value etc.. User can fill whichever the field they want and ...
1
vote
0
answers
840
views
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 ...
0
votes
1
answer
216
views
build every group of data and add them to the rendered XML page using xmlbuilder2
I'm using xmlbuilder2 node module to build the retrieved data and render them into XML page. when the data is very big I got this error
FATAL ERROR: Ineffective mark-compacts near heap limit ...
1
vote
1
answer
5k
views
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 ...
2
votes
2
answers
21k
views
JSON to XML conversion in Node JS service (using xml2js)
I need some help/advice with JSON to XML conversion in Node js.
I have a service that gets a JSON object in request body that needs to convert to XML. I am able to achieve this using node-xml2js for ...
0
votes
1
answer
2k
views
Creating nested XMLs in node using xmlbuilder
I am using the following framework to build my xmls
https://www.npmjs.com/package/xmlbuilder
When I do the following
.ele('ATTACHMENTS','')
.ele('ATTACHMENT', attachmentXML)
I have another ...
0
votes
0
answers
46
views
How to make output in 1 row for xml.builder?
I want have output in 1 row text:
<A><d>n</d>Im newspaper text</A>
I used
xml.A { |t| t.d "n"; t.text! advert.newspaper_text }
In this case i have output:
<A>
<d&...
0
votes
1
answer
449
views
How to generate xml tags dynamically from Rails DB using Nokogiri XML Builder
I want to build xml from rails application. I wanted to generate tags from rails application database.
For example: I have a database table called cars and it have variable brand and it has values.
...
3
votes
2
answers
4k
views
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:
<notestext><![CDATA[{Notes Text}]]></notestext>
I referred the github link, ...
1
vote
2
answers
330
views
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 = ...
0
votes
2
answers
877
views
Passing a variable or property value to a method in a JavaScript object returns "undefined"
I'm trying to build an xml file from 2 JSON objects through 2 cascading loops. In the second loop, I can't find how to pass a value from the previous loop:
In the example below, I would like to pass ...
0
votes
0
answers
1k
views
how to stream a large xml response from express
I am trying to stream a large xml file from express to a client, and I have not yet found out how to send until the file is done processing on the server, and res.end() is called.
The xml file is ...
1
vote
0
answers
2k
views
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....
3
votes
1
answer
2k
views
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 ...
1
vote
0
answers
161
views
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 ...
0
votes
1
answer
239
views
Xml not parsing string
I have following string
"The quic\b\b\b\b\b\bk brown fo\u0007\u0007\u0007\u0007\u0007\u0007\u0007\u0007\u0007\u0007\u0007x... [Beeeep]"
But xmlBuilder and xml2js fails to parse this string due to ...
1
vote
0
answers
176
views
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, ...
5
votes
1
answer
2k
views
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
<nsA:root xmlns:nsA="namespaceA" xmlns:nsB="namespaceB">
<nsB:...
0
votes
1
answer
730
views
Add prefix to XML root node
I am using Nokogiri to generate XML. I would like to add a namespace prefix to the XML root node only but the problem is applying the prefix to the first element it get apply to all children elements.
...
2
votes
1
answer
2k
views
Testing XmlBuilder with Rspec
I posted a question (Rails XML builder not rendering) regarding rendering XML using XmlBuilder. That particular issue was resolved but I’ve run into another issue testing this controller action.
The ...
0
votes
2
answers
65
views
XML Building in C# Windows or ASP Application
I am passing lot of XML Parameters from my application to the SQL Server (both windows and ASP.Net application)
Earlier i used to build XML using the based concatenation operator in string, similar ...
12
votes
3
answers
42k
views
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 ...
0
votes
1
answer
561
views
How to get write unencoded html to a file?
I'm using reading in a .HTML snippet from the file system; it contains just <h1>Hulton Archive</h1>. Then I'm writing a new XML file which must contain that HTML snippet in a certain ...
0
votes
0
answers
44
views
content_for for xml.builder
Is it possible to use content_for in *.xml.builder files?
when I print:
content_for :part do
xml.child "anything"
end
xml.parent do
xml << yield(:part) if content_for? :part
end
it ...
0
votes
1
answer
75
views
How to build a running value in Rails?
This is the XML function to create XML dynamically:
def make_toc
builder = Nokogiri::XML::Builder.new do |xml|
xml.ncx( xmlns: "http://www.daisy.org/z3986/2005/ncx/", version: "2005-1", "xml:...
1
vote
2
answers
1k
views
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/...
1
vote
2
answers
2k
views
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....
0
votes
1
answer
130
views
Is there is an interface to deal with as XML file?
I made an application that depends on the data taken form an XML file, and if the user want to update something in that application he have to change the data contained in that xml file, but for sure ...
4
votes
1
answer
733
views
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 ...
9
votes
2
answers
10k
views
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 ...
0
votes
1
answer
377
views
How can I modify a previously set XML node in Ruby?
I have a function like so:
def add_auth_fields
xml = Builder::XmlMarkup.new(:target => '')
xml.instruct! :xml
xml.inquiry do |inquiry|
inquiry.authentication do |auth|
...
3
votes
2
answers
7k
views
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 ...
1
vote
1
answer
408
views
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 ...
12
votes
1
answer
6k
views
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 '...
1
vote
1
answer
636
views
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:...
2
votes
1
answer
868
views
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.
...
0
votes
1
answer
594
views
rails 3 XML builder: return no XML element when there's no data
I get this nice XML when there's data in the fields:
<DescriptiveDetail>
<ProductComposition>00</ProductComposition>
<ProductForm>01</ProductForm>
<Measure>
...