targetNamespace and xmlns without prefix, what is the difference?

targetNamespace is an XML Schema “artifact”; its purpose: to indicate what particular XML namespace the schema file describes. xmlns – because the XML Schema is an XML document, it is then possible to define a default XML namespace for the XML file itself (this is what xmlns attribute does); the implications are multiple: authoring, and … Read more

f:viewParam doesn’t pass required parameter when new xmlns.jcp.org namespace is used

The way how the new xmlns.jcp.org XML namespaces are been handled is broken in the first Mojarra releases 2.2.0 and 2.2.1. It has been fixed in Mojarra 2.2.2 (note: ticket in the link describes different problem symptom, but under the covers, it’s essentially the same cause). It’s recommended to upgrade to Mojarra 2.2.2. GlassFish 4.0 … Read more

Remove namespace from XML using PHP

I found the answer above to be helpful, but it didn’t quite work for me. This ended up working better: // Gets rid of all namespace definitions $xml_string = preg_replace(‘/xmlns[^=]*=”[^”]*”/i’, ”, $xml_string); // Gets rid of all namespace references $xml_string = preg_replace(‘/[a-zA-Z]+:([a-zA-Z]+[=>])/’, ‘$1’, $xml_string);

What is the difference between xsd and xsi?

xsd and xsi Similarities Both are XML namespace prefixes, abbreviations for an XML namespace. Both are, as are all namespace prefixes, arbitrarily named; other namespace prefix abbreviations could equally well be used. However, both prefixes are conventional and therefore recommended. (An also-conventional alternative to xsd is xs.) xsd and xsi Differences The xsd (or xs) … Read more

What is an xs:NCName type and when should it be used?

@skyl practically provoked me to write this answer so please mind the redundancy. NCName stands for “non-colonized name”. NCName can be defined as an XML Schema regular expression [\i-[:]][\c-[:]]* …and what does that regex mean? \i and \c are multi-character escapes defined in XML Schema definition. http://www.w3.org/TR/xmlschema-2/#dt-ccesN \i is the escape for the set of … Read more

Writing XML attributes and namespace declarations in a specific order

XML attribute and namespace declaration order should never matter Attribute order is insignificant per the XML Recommendation: Note that the order of attribute specifications in a start-tag or empty-element tag is not significant. Namespace declaration are like attributes (W3C Namespaces in XML Recommendation, section 3 Declaring Namespaces), [Definition: A namespace (or more precisely, a namespace … Read more

Why is my WCF web service presenting this object in a different namespace with different field names?

It is stunning how many hours I’ve spent on this, how many solutions I’ve tried, how many links I’ve followed, and how many SO answers I’ve read that did not answer my question before finally finding that the answer was sitting right here on SO for more than 2 years! The root problem is that … Read more