use xsl to output plain text

You can define a template to match on script/command and eliminate the xsl:for-each concat() can be used to shorten the expression and save you from explicitly inserting so many <xsl:text> and <xsl:value-of> elements. The use of an entity reference &#xA; for the carriage return, rather than relying on preserving the line-break between your <xsl:text> element … Read more

Oracle Pl/SQL: Loop through XMLTYPE nodes

You can loop through the elements using EXTRACT and XMLSequence (splits the XML into distinct chunks — here users) like this: SQL> SELECT extractvalue(column_value, ‘/user/name’) “user” 2 FROM TABLE(XMLSequence(XMLTYPE( 3 ‘<?xml version=”1.0″?> 4 <users> 5 <user> 6 <name>user1</name> 7 </user> 8 <user> 9 <name>user2</name> 10 </user> 11 <user> 12 <name>user3</name> 13 </user> 14 </users>’).extract(‘/users/user’))) t; … Read more

Best compression algorithm for XML?

There is a W3 (not-yet-released) standard named EXI (Efficient XML Interchange). Should become THE data format for compressing XML data in the future (claimed to be the last necessary binary format). Being optimized for XML, it compresses XML more ways more efficient than any conventional compression algorithm. With EXI, you can operate on compressed XML … Read more

nillable and minOccurs XSD element attributes

You need to decide whether you are thinking about XML as XML, or whether you are thinking about XML as a way to transmit Java (or other) object from here to there. In XML, nillable permits the construction <myelement xsi:nil=”true”/> as an indicator of an explicit absent value, like an SQL NULL. This is semantically … Read more

SVG image tag not working

You got the namespaces wrong. change xmlns=”localhost” xmlns:xlink= “localhost/svgtest” to xmlns=”http://www.w3.org/2000/svg” xmlns:xlink= “http://www.w3.org/1999/xlink” Maybe you should have a look at this Namespaces Crash Course by MDN.

Mocking WebResponse’s from a WebRequest

I found this question while looking to do exactly the same thing. Couldn’t find an answer anywhere, but after a bit more digging found that the .Net Framework has built in support for this. You can register a factory object with WebRequest.RegisterPrefix which WebRequest.Create will call when using that prefix (or url). The factory object … Read more

Converting XML to plain text – how should I ignore/handle whitespace in the XSLT?

There are three reasons for getting unwanted whitespace in the result of an XSLT transformation: whitespace that comes from between nodes in the source document whitespace that comes from within nodes in the source document whitespace that comes from the stylesheet I’m going to talk about all three because it can be hard to tell … Read more

Write to XML in ruby

Builder should probably be your first stopping point: require ‘builder’ def product_xml xml = Builder::XmlMarkup.new( :indent => 2 ) xml.instruct! :xml, :encoding => “ASCII” xml.product do |p| p.name “Test” end end puts product_xml produces this: <?xml version=”1.0″ encoding=”ASCII”?> <product> <name>Test</name> </product> which looks about right to me. Some Builder references: author’s (Jim Weirich) original blog … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)