xml-namespaces

Remove xmlns from XML using XSLT

蓝咒 提交于 2019-12-24 11:27:27
问题 I have an XML as below and looking to remove the SOAP envelope and body from the request and generate as below. Current XML <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <AsnPODetailsRequest> <AsnPODetails> <RequestSourcedFrom>EDI</RequestSourcedFrom> <ValidationLevelInd></ValidationLevelInd> <AdvanceShipmentNotificationId></AdvanceShipmentNotificationId> <PoAttributeList> <PoAttribute> <Department></Department>

WCF contracts - namespaces and SerializationExceptions

六眼飞鱼酱① 提交于 2019-12-24 09:50:57
问题 I am using a third party web service that offers the following calls and responses http://api.athirdparty.com/rest/foo?apikey=1234 <response> <foo>this is a foo</foo> </response> and http://api.athirdparty.com/rest/bar?apikey=1234 <response> <bar>this is a bar</bar> </response> This is the contract and supporting types I wrote [ServiceContract] [XmlSerializerFormat] public interface IFooBarService { [OperationContract] [WebGet( BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat =

Simple-Framework: Duplicate annotation (different namespace)

可紊 提交于 2019-12-24 05:40:11
问题 I have an Rss feed that I'd like to parse in Java using Simple Framework. I have problems with 2 elements with the same name, but one of them has a namespace assigned. Here is an example xml: <?xml version="1.0" encoding="UTF-8"?> <rss xmlns:dc="http://purl.org/dc/elements/1.1/"> <item> <title>Regular Titel</title> <dc:title>Dc Titel</dc:title> </item> </rss> Currently my Item.class looks like this: @Root public class Item { @Namespace(reference = "http://purl.org/dc/elements/1.1/", prefix =

WCF XML deserialization is being very picky about namespaces and aliases

我是研究僧i 提交于 2019-12-24 05:15:48
问题 I am writing a .net WCF SOAP service, trying to integrate with a Java client. The process is a bit unusual, because the client has specified the WSDL, and I have to create a service which can accept requests from them. Im getting some very finicky results when we try to perform the integration. Very subtle differences (that appear to be ok to my eyes) cause the XML deserialization to fail. This is the XML actually produced by the client, which ends up giving me null values for all the child

How to use XQuery/T-SQL to parse customer xml that contains nested default namesapces

萝らか妹 提交于 2019-12-24 04:21:58
问题 I have a customer using a platform we have developed that allows customer webservice return data to be parsed by a stored procedure in MSSQL. We have a customer sending xml back that contains nested xmlns="xxxxxx" declarations that are to different URI locations. First off is this valid? And secondly is it possible to parse using XQuery? I have tried using both .value and .query capabilities of the t-sql xml datatype to try to work through the issue but the point where the "second default

How to mention namespace in XSLT file when the namespaces are dynamic?

こ雲淡風輕ζ 提交于 2019-12-24 03:55:22
问题 I have a requirement to store XML data in DB and after that retrieve xml from DB and convert to PDF. For that I am using XSLT with Apache FOP. The below code is working fine with current namespaces in the XML file(I have copied and pasted the namespaces from Books.xml file to Books.xsl . The Problem is whenever the WebService is updated if the namespace of Books.xml file is changed then my Books.xsl file with old namespaces is giving exception while generating PDF using Apache FOP. Note : If

Trouble with Namespaces in T-SQL FOR XML queries

谁都会走 提交于 2019-12-24 03:10:22
问题 I have a question about using SQL Server FOR XML to create XML documents with namespaces. I need to create a document like below where there is a namespace definition in the root element ( xmlns:ijk="h:/i.j.k" ), and a namespace reference in a child element attribute ( ijk:LMNO="3333" ). I am generating the XML to POST to a Web service: <ROOT xmlns:ijk="h:/i.j.k" RSTU="1111"> <CHILD CDEF="2222" ijk:LMNO="3333" /> </ROOT> I wrote this first sample query to get the structure correct before I

How to add prefix in front of xml element using attribute in c#

假如想象 提交于 2019-12-24 01:57:22
问题 with the programming is this: As a result I want to have this: <rootprefix:rootname noPrefix="attribute with no prefix" firstprefix:attrOne="first atrribute" secondprefix:attrTwo="second atrribute with different prefix"> ...other elements... </rootprefix:rootname> The way to do this by coding is: NameTable nt = new NameTable(); nt.Add("key"); XmlNamespaceManager ns = new XmlNamespaceManager(nt); ns.AddNamespace("firstprefix", "fp"); ns.AddNamespace("secondprefix", "sp"); root.SetAttribute(

Remove XML namespaces with XML::LibXML

眉间皱痕 提交于 2019-12-24 01:18:56
问题 I'm converting an XML document into HTML. One of the things that needs to happen is the removal of namespaces, which cannot be legally declared in HTML (unless it's the XHTML namespace in the root tag). I have found posts from 5-10 years ago about how difficult this is to do with XML::LibXML and LibXML2, but not as much recently. Here's an example: use XML::LibXML; use XML::LibXML::XPathContext; use feature 'say'; my $xml = <<'__EOI__'; <myDoc> <par xmlns:bar="www.bar.com"> <bar:foo/> </par>

simplexml and accessing feedburner's : [duplicate]

耗尽温柔 提交于 2019-12-24 00:42:56
问题 This question already has an answer here : Reference - how do I handle namespaces (tags and attributes with colon in) in SimpleXML? (1 answer) Closed last year . I'm trying trying to use simplexml to read a feedburner xml. I can read every properties in the xml but not the keys with ':' in it. Example "feedburner:origLink". When I vardump the items, those keys with : doesn't show up. And I can't do like $s->item->feedburner:origLink. 回答1: You're dealing with namespaces, and this Sitepoint