xml-namespaces

xmlns, xmlns:xsi, xsi:schemaLocation, and targetNamespace?

你说的曾经没有我的故事 提交于 2019-12-17 02:21:17
问题 For the following XML fragment: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> What do the xmlns , xmlns:xsi , and xsi:schemaLocation attributes exactly mean? How are they related? What's the : for? And there are 2 URLs in the xsi:schemaLocation= http://maven.apache.org/POM/4.0.0 (it happens to be the same as xmlns but it gives a 404

Import xs:attributeGroups to multiple namespaces xsd

限于喜欢 提交于 2019-12-14 03:58:14
问题 I have an attributeGroup with long list of allowed attributes say a:attr-group, that I import to another xsd to restrict an element's (defined in another xsd) allowed attributes with. I also want to allow the same element to use the same attributes under a second namespace say b:attr-group, and wish to use the same file (rather than repeat all the attributes and group definition). Is there a simple way of doing this? All my attempts so far have been thwarted by the import namespace must equal

Configuring an XML Namespace

天涯浪子 提交于 2019-12-14 02:54:20
问题 I have made an XML generator with a few different options, one is a style option which defines whether to use attributes or elements for primitive data types. XML schemas aren't supported right now, but I need to allow the setup of an XML Namespace, and I have been doing some research. My understanding is the XML namespace can have a prefix, but it doesn't have to. It also needs a unique string attribute value that is usually a URI, but doesn't have to be. I am a little bit confused, as I am

How do I match SQL table rows with XML namespace elements?

☆樱花仙子☆ 提交于 2019-12-13 20:08:08
问题 I've successfully saved down this XML file to my server using the following PHP: file_put_contents("test.xml", fopen("http://www.treasury.gov/resource-center/data-chart-center/interest-rates/pages/XmlView.aspx?data=yieldyear&year=2015", 'r')); Now i'm trying to get it into my DB. Just trying to get it to work by executing SQL in the phpMyAdmin GUI. I successfully setup the following table: CREATE TABLE `test` ( `NEW_DATE` varchar(40) NOT NULL, `BC_1MONTH` int(11) NULL, `BC_3MONTH` int(11)

Copy all xml elements excluding matched element root name using xslt

你离开我真会死。 提交于 2019-12-13 19:24:27
问题 Input XML: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ns2:VendorMessageRequest xmlns:ns2="http://order.com.company.com"> <ns2:purchaseOrder> <assignedTo> <firstName>firstnm</firstName> <lastName>lstnm</lastName> </assignedTo> </ns2:purchaseOrder> </ns2:VendorMessageRequest> using XSLT as: <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns2="http://www.company.com/services/entity/v1" xmlns:ns3="http://www.company.com/services/dataobject/v1"

Changing a namespace value in an XSL transformation?

烈酒焚心 提交于 2019-12-13 16:21:39
问题 I'm not sure if that is possible, as I'm very new to XSLT and stuff, but maybe some of you could help me here? It's a bit tricky and I haven't found anything like it on the internet: The problem is that I have an input xml with namespaces declared and all and I only need to make slight changes to it (adding or deleting attributes, or shifting them to other locations). But at the same time, I have to update the namespace references in the document's document tag. So, for example, the input xml

data lost in simplexml_load_string

[亡魂溺海] 提交于 2019-12-13 15:27:40
问题 I am reading xml with this code. $xml = simplexml_load_string($data); it reads correctly, and can access to data via $xml->title etc. but i need to access to CDATA and <media:xxx> tags. example of xml: pastie from: http://www.metacafe.com/api/item/4779040/ is possible to parse that data? how? 回答1: $xml = simplexml_load_string($data); $namespacesMeta = $xml->getNamespaces(true); $mediaXML = $xml->children($namespacesMeta['media']); 回答2: You need to look into SimpleXml and Namespaces Try this -

XElement default namespace on attributes provides unexpected behaviour

丶灬走出姿态 提交于 2019-12-13 15:09:58
问题 I am having trouble creating an XML document that contains a default namespace and a named namespace, hard to explain easier to just show what I am trying to produce... <Root xmlns="http://www.adventure-works.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:SchemaLocation="http://www.SomeLocatation.Com/MySchemaDoc.xsd"> <Book title="Enders Game" author="Orson Scott Card" /> <Book title="I Robot" author="Isaac Asimov" /> </Root> but what I end up with is this... <Root xmlns="http

How to get rid of namespace when marshaling generic objects with JAXB

为君一笑 提交于 2019-12-13 14:12:59
问题 I use the following code to serialize a class: public String serialize(T oObject) { mMarshaller = getJAXBContext().createMarshaller(); mMarshaller.setProperty(javax.xml.bind.Marshaller.JAXB_ENCODING, "UTF-8"); ByteArrayOutputStream strm = getOutputStream(); mMarshaller.marshal(oObject, strm); return strm.toString(); } But when I look at the generaetd XML there is a namespace in there: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <mapEntry> <key xmlns:xsi="http://www.w3.org/2001

How can I prevent appendChild() from adding the xmlns=“”

有些话、适合烂在心里 提交于 2019-12-13 07:59:19
问题 Here is a snippet of my code. FilterText = HttpUtility.UrlDecode(FilterTxt.Value.ToString()); XmlWriterSettings settings = new XmlWriterSettings(); settings.Indent = true; TextWriter tw = new StreamWriter("D:\\FilterTest.rdl"); tw.WriteLine(FilterText); tw.Close(); XmlDocument reportrdl = new XmlDocument(); reportrdl.Load(ReportFile); NMS = reportrdl.NamespaceURI; XmlNodeList fieldsnode = reportrdl.GetElementsByTagName("DataSet"); //XmlElement xoo = reportrdl.CreateElement("Filters", NMS); /