HBase REST Filter ( SingleColumnValueFilter )

Filter fields in the Scanner XML are strings formatted as JSON. Since the JSON for the filter has many quotes in it, I recommend using a separate file for curl’s -d parameter, to avoid the single quote. curl -v -H “Content-Type:text/xml” -d @args.txt http://hbasegw:8080/table/scanner Where the file args.txt is: <Scanner startRow=”cm93MDE=” endRow=”cm93MDg=” batch=”1024″> <filter> { … Read more

Splitting XML into multiple files with XSLT

Responding to your comment on @Dimitre’s answer… You wrote, <xsl:template match=”https://stackoverflow.com/”> <xsl:for-each select=”elem/file”> <xsl:result-document method=”xml” href=”https://stackoverflow.com/questions/4036233/file_{@id}-output.xml”> <xsl:copy-of select=”.”/> </xsl:result-document> </xsl:for-each> </xsl:template> This doesn’t quite match your XML, which has rootelem as an outermost element, and your comment says root as an outermost element. You probably want something like this: <xsl:template match=”/root”> <xsl:for-each select=”elem/file”> <xsl:result-document method=”xml” … Read more

XML Schema: Element that can contain elements or text?

I did some research on this a while ago and the only solution I found was to used the mixed attribute: <xs:element name=”field”> <xs:complexType mixed=”true”> <xs:sequence> <xs:element ref=”subfield” minOccurs=”0″ maxOccurs=”unbounded” /> </xs:sequence> <xs:attribute name=”name” type=”xs:string” /> </xs:complexType> </xs:element> This sadly also allows <field name=”test_field_0″> Some text I’m sure you don’t want. <subfield>Some text.</subfield> More text … Read more

Opening JSF Facelets page shows “This XML file does not appear to have any style information associated with it.”

This XML file does not appear to have any style information associated with it. The document tree is shown below. You will get this message in the client side when the client (the web browser) for some reason interprets the HTTP response content representing a HTML document as text/xml instead of text/html and the parsed … Read more

How to insert a new element under another with xmlstarlet?

I had a similar problem: I had a Tomcat configuration file (server.xml), and had to insert a <Resource> tag with pre-defined attributes into the <GlobalNamingResources> section. Here is how it looked before: <GlobalNamingResources> <!– Editable user database that can also be used by UserDatabaseRealm to authenticate users –> <Resource name=”UserDatabase” auth=”Container” type=”org.apache.catalina.UserDatabase” description=”User database that … Read more

SVG in HTML5 – when is XML declaration “ needed?

For HTML5, the correct DOCTYPE declaration is <!DOCTYPE html> It is needed to specify full standards mode to the browser. What you’ve shown, <?xml version=”1.0″ encoding=”utf-8″?> is an XML declaration. It is optional for XML 1.0 and required for XML 1.1, but XML 1.1 isn’t in widespread use. version=”1.0″ and encoding=”utf-8″ are the defaults anyway. … Read more

XML: do child nodes inherit parent’s namespace prefix?

No. Child nodes do not inherit prefixed namespace by default, and explicit prefix addition needed as you mentioned : <foo:child/>. But they do inherit ancestor’s default namespace (the one without prefix), if any : <root xmlns:foo=”…”> <parent xmlns=”bar”> <child/> </parent> </root> <parent> and <child> nodes are in the same namespace which URI is bar.