Tag: xml

在节点中模拟ejs for xml

我有一个大的格式良好的XML,我想模板就像ejs。 <foo> <url><%= url %></url> <foo> 但如果我这样做 res.render('template.xml', { url: 'http://foo.com' }) 我正进入(状态 Error: Cannot find module 'xml' 任何人都可以build议如何处理它? 我只需要在已经形成的XML中插入值,我不想通过模式序列化对象到XML。

在Node JS中使用fs-extra更新xml文件

我想读取特定的XML标签,并更新它。 这里是xml文件 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <widget id="com.ionicframework.myapp450442" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <name>myApp</name> <description> An Ionic Framework and Cordova project. </description> <author email="hi@ionicframework" href="http://ionicframework.com/"> Ionic Framework Team </author> <content src="index.html"/> <access origin="*"/> <preference name="webviewbounce" value="false"/> <preference name="UIWebViewBounce" value="false"/> <preference name="DisallowOverscroll" value="true"/> <preference name="android-minSdkVersion" value="16"/> <preference name="BackupWebStorage" value="none"/> <feature name="StatusBar"> <param name="ios-package" value="CDVStatusBar" onload="true"/> </feature> </widget> 我在堆栈上的stream程中跟着这个类似的问题,但它并没有为我工作。 […]

node-soap客户端中的数组字段的名称空间(Node.js)

如何为数组configurationnode-soap客户端集名称空间不仅用于对象? 我的“sendPatient”方法的参数: params = { patientCard: { patient: { firstName: 'test', lastName: 'test' }, identifiers: { code: "123456789", codeType: 1 } } }; client.sendPatient(params, …) 节点肥皂产生: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://xxx/patient/api/" xmlns:bi="http://xxx/base/info/build/"> <soap:Header></soap:Header> <soap:Body> <tns:sendPatient xmlns:tns="http://xxx/patient/api/" xmlns="http://xxx/patient/api/"> <tns:patientCard> <ns1:patient xmlns:ns1="http://xxx/patient/"> <ns1:firstName>test</ns1:firstName> <ns1:lastName>test</ns1:lastName> </ns1:patient> <ns1:identifiers xmlns:ns1="http://xxx/patient/"> <ns1:code>123456789</ns1:code> <ns1:codeType>1</ns1:codeType> </ns1:identifiers> </tns:patientCard> </tns:sendPatient> </soap:Body> </soap:Envelope> 它的工作原理,但我需要发送标识符数组,不仅一个,所以当我把数组 params = { […]

node.js xml xsdvalidation

那么我可以在Node.js中使用XSDvalidation吗? 我试过search,但没有得到结果。 请帮忙。 我现在可以使用xmllint,但我想使用一些模块。 所以我看到了同样的问题一岁,但我想也许有些年份有所改变。

nodejs xmlrpc错误:错误:XML-RPC错误:从input数据中find多个源模板:

我试图从节点应用程序消耗xmlrpc webservice( 摇头,往下看 ),我遇到了一些问题。 这是我想要发射的有效载荷: <SOAP-ENV:Envelope xmlns:m="urn:ActionWebService" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <VmProvisionRequest xmlns="urn:ActionWebService"> <version xsi:type="xsd:string">1.1</version> <templateFields xsi:type="xsd:string">blah blah</templateFields> <vmFields xsi:type="xsd:string">blah blah</vmFields> <requester xsi:type="xsd:string">blah blah</requester> <tags xsi:type="xsd:string"></tags> <options xsi:type="m:VmdbwsSupport..ProvisionOptions"> <values xsi:type="xsd:string"></values> <ems_custom_attributes xsi:type="xsd:string"></ems_custom_attributes> <miq_custom_attributes xsi:type="xsd:string">blah blah</miq_custom_attributes> </options> </VmProvisionRequest> </SOAP-ENV:Body> </SOAP-ENV:Envelope> 但在节点的xmlrpc库中 ,当我在客户端上做一个methodCall时,我只能通过params(一个迭代的数组列表来生成序列化器中的xml) 这是我想要做的: var xmlrpc = require('xmlrpc') var request = '<SOAP-ENV:Envelope xmlns:m="urn:ActionWebService" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" […]

是否有Node.js的XSDvalidation程序?

我需要在node.js应用程序中validationXML。我已经发现了这一点 ,但它基本上是一个Java插件,尽pipe有很好的双关语制作机会,但我并不希望在JavaScript中使用Java。 那么是否有一个本地节点模块可以validation基于XSD架构的XML? (1.1兼容性非常好)

Node.js / Express:读取XML Post,Amazon IPN

我想使用亚马逊的IPN。 到目前为止,我从来没有使用XML,只是用req.body.param访问POST req.body.param 。 这似乎并没有工作。 亚马逊发送一个结构如下的发布请求: POST / HTTP/1.1 x-amz-sns-message-type: Notification x-amz-sns-message-id: 0000000-0000-00000-0000-00000EXAMPLE x-amz-sns-topic-arn: arn:aws:sns:EXAMPLE:11111EXAMPLE:TestTopic x-amz-sns-subscription-arn: arn:aws:sns:EXAMPLE:11111EXAMPLE:TestTopic: EXAMPLE Content-Length: 999 Content-Type: text/plain; charset=UTF-8 Host: ec2-EXAMPLE.compute-1.amazonaws.com Connection: Keep-Alive User-Agent: Amazon Simple Notification Service Agent { Type : Notification, MessageId : xxxxxx-xxxx-xxxx-xxxx-xxxxxEXAMPLE, TopicArn : arn:aws:sns:EXAMPLE:11111EXAMPLE:TestTopic, Message : { NotificationReferenceId: 1111111-1111-11111-1111-11111EXAMPLE, NotificationType: OrderReferenceNotification, SellerId: A3PJMS5WFYSRB4, ReleaseEnvironment: Sandbox, Version: […]

用NodeJS写入一个大的XML文件,而不用重写整个XML文件

我正在编写一个Web应用程序(使用NodeJS),允许监视小型计算机/设备(如Freebox)。 要添加一个新的设备来监视,你必须从一个专门的菜单在Web应用程序中以graphics方式创build它。 设备存储在一个用XML编写的文件中:XML是一种强制性格式,我不能采取任何其他措施。 在表示对象“设备”的XML块中,一些字段将不会修改:名称,制造商,模型,… 相反,其他字段经常更新(连接date,RAM信息,CPU信息,…),并在XML文件中产生大量的文字。 为了写入XML文件,我使用了Node模块'xmldom',它需要locking来写入并完全重写文件。 performance的水平不是我所希望的。 而且,这种写作方式不能抵抗我的服务器的突然关机。 我的问题是:解决我的问题最好的方法和技术是什么,并回答以下约束: – 经常写入数据,而不必每次都重写整个XML文件 – 在发生崩溃(突然closures)

Node.js – Craigslist批量发布API(无法parsingrss)

我正在使用craigslist的批量发布API。 我写了一个如下所示的快速脚本: var https = require('https'); var posting = '<?xml version="1.0"?><rdf:RDF xmlns="http://purl.org/rss/1.0/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cl="http://www.craigslist.org/about/cl-bulk-ns/1.0"><channel><items><rdf:li rdf:resource="NYCBrokerHousingSample1"/><rdf:li rdf:resource="NYCBrokerHousingSample2"/></items><cl:auth username="example@example.com" password="example" accountID="14"/></channel><item rdf:about="NYCBrokerHousingSample1"><cl:category>fee</cl:category><cl:area>nyc</cl:area><cl:subarea>mnh</cl:subarea><cl:neighborhood>Upper West Side</cl:neighborhood><cl:housingInfo price="1450" bedrooms="0" sqft="600"/><cl:replyEmail privacy="C">bulkuser@bulkposterz.net</cl:replyEmail><cl:brokerInfo companyName="Joe Sample and Associates" feeDisclosure="fee disclosure here" /><title>Spacious Sunny Studio in Upper West Side</title><description><![CDATA[posting body here]]></description></item><item rdf:about="NYCBrokerHousingSample2"><cl:category>fee</cl:category><cl:area>nyc</cl:area><cl:subarea>mnh</cl:subarea><cl:neighborhood>Chelsea</cl:neighborhood><cl:housingInfo price="2175" bedrooms="1" sqft="850" catsOK="1"/><cl:mapLocation city="New York" state="NY" crossStreet1="23rd Street" crossStreet2="9th Avenue" latitude="40.746492" […]

如何在读取xml文件时保留数字实体?

我正在使用Node.js并阅读包含xml标签的文本文件。 该文本文件包含 Student Writer’s 读完文件后 fs.readFile(filePath, {encoding: 'UTF-8'}, function(err,data){ if (!err){ var xmldoc = parser.parseFromString(data,"text/xml"); console.log("xmdata"+xmldoc); } } 该文件的输出是 Student Writer's Manual 注意:我不是在浏览器中阅读。 我检查了编辑模式(在nodepad中) 但是我想保留这个xml文件。 喜欢 Student Writer’s 如何在输出文件中保留数字实体? 任何一个人帮助我? 提前致谢。