1 December 2014

Setting the JAXP validation file (updated)

A JAXP parser validates (version >= 1.2) by default using a DTD. Here are some variations that can be used when validating

  • If you are using SAX and obtained this parser from the SAXParserFactory:
  • javax.xml.parsers.SAXParser parser
    • To validated using a schema (xsd) add this line of code to your parser setup:
    • parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", 
        XMLConstants.W3C_XML_SCHEMA_NS_URI); 
    • To specify the schema file in your code (for both DTD and XSD) add this line to your parser setup:
    • parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource", 
        new File("checkers.xsd")); 
                  SL-385.B: add to code 3-2 after line 17   
      • The source can be a File, InputStream, InputSource or an Object array containing these types
  • If you are using DOM, and you created this DocumentBuilderFactory instance :
  • javax.xml.parsers.DocumentBuilderFactory builder
    • To validated using a schema (xsd) add this line of code to your parser setup:
    • builder.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLanguage", 
        XMLConstants.W3C_XML_SCHEMA_NS_URI);
      • XMLConstants.W3C_XML_SCHEMA_NS_URI = http://www.w3.org/2001/XMLSchema
      • The corresponding constant for DTD (the default) in these cases is  
      • XMLConstants.XML_DTD_NS_URI = http://www.w3.org/TR/REC-xml
    • To specify the schema file in your code (for both DTD and XSD) add this line to your parser setup:
    • builder.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaSource", 
        new File("checkers.xsd")); 

22 November 2014

JAXP history (updated)

Java SE JAXP What’s new
DOM level 0: javascript in NS/IE v3
1.0
DOM level 1 (tree), SAX 1.0 (push)
org.xml.sax.Parser
1.4
1.1
DOM Level 2, SAX 2.0 (+validation), TrAX (XSLT)
Apache Crimson XMLReader
1.2
XML Schema
Apache Xerces2 XMLReader
5
1.3
DOM level 3, XML 1.1, XInclude 1.0, Xpath 1, Validator API
6
1.4
StAX (pull)
SE also bundles JAXB
7u40
1.5
8
1.6
9
- no separate JAXP anymore, moved into Java SE

More details on DOM levels.

Customer Journey

Slightly modified version of Oracle Customer Journey to emphasize the shift to "pay as you go" consumption from a presentation by Matthew Banks:


13 November 2014

IDEA 14: show debugger values in editor

Nifty innovation by IntelliJ. You can see variable values in grey at the right hand side, while the debugger walks through your code:


25 September 2014

Hybris 5.3 released

Highlights:

  • Data Hub / SAP ERP integration 

    • SAP ERP order integration
      • Replicate master data from SAP ERP
        • Products
        • customers
        • pricing (includes SAP Retail discounts and bonuses)
      • send orders to be fulfilled to SAP ERP
    • online customers can configure complex products based on SAP Configure, Price and Quote rules
    • online customers can also see their physical store purchases stored in SAP Customer Activity Repository (CAR)
    • Hybris can send customer and order related information to SAP Customer Engagement Intelligence (CEI) and use the resulting segmentation information for targeting and personalisation
  • B2B restful API. This is also an enabler for B2B mobile HTTP and Android clients and a sample app.
  • When an anonmymous user log in, merge his session cart with the cart stored against the customer account
  • Update nodes in a live cluster
And a no-show of the Data Hub cockpit :(

15 September 2014

RAID

An colleague instructor from the old Sun days pointed me to this:

28 August 2014

Russia said to react on Western sanctions with cyber attacks

Russia is suspected of cyber attacks on Western banks, in a reaction to Western financial sanctions in the Ukrania crisis. More...