5-week old serval kittens playing. They’re as big as adult domestic cats!
That Husky seems to like that ferocious kitten:
5-week old serval kittens playing. They’re as big as adult domestic cats!
That Husky seems to like that ferocious kitten:
Mutegi is an F1 Savannah Cat. Savannah Cats are the result of crossbreeding domestic cats with Servals. F1 generation Savannah Cats are 50% Serval, genetically speaking!
Handling <xs:any> with XML Beans
This article explains how to add an XmlObject to another XmlObject. In this case, the parent XmlObject has children of type <xs:any>. The tricky part is that XML Beans does not create accessor methods for
<xs:any>
elements.
In my case, I was creating a SOAP response. Here’s the snippet that creates a SOAP fault:
// SOAP schema XML Bean imports import org.xmlsoap.schemas.soap.envelope.Body; import org.xmlsoap.schemas.soap.envelope.Detail; import org.xmlsoap.schemas.soap.envelope.Envelope; import org.xmlsoap.schemas.soap.envelope.EnvelopeDocument; import org.xmlsoap.schemas.soap.envelope.Fault; import org.xmlsoap.schemas.soap.envelope.FaultDocument; import org.xmlsoap.schemas.soap.envelope.Header; // DOM Imports import org.w3c.dom.Element; import org.w3c.dom.Node;... now the real code // the XML document looks like this: <envelope> <body> <fault> ... </fault> </body> <envelope> // create envelope and body EnvelopeDocument responseEnv = EnvelopeDocument.Factory.newInstance(); Body responseBody = responseEnv.addNewEnvelope().addNewBody(); // create fault, must be a FaultTDocument. If you just create a // Fault instance, it will be an an XML fragment, nothing will work FaultDocument faultDoc = FaultDocument.Factory.newInstance(); Fault fault = faultDoc.addNewFault(); fault.setFaultcode(new QName("http://schemas.xmlsoap.org/soap/envelope/", "Client")); ... some more code that populates the fault object // now the tricky part Node bodyNode = responseBody.getDomNode(); importedNode = bodyNode.getOwnerDocument().importNode(faultDoc.getFault().getDomNode(), true); bodyNode.appendChild(importedNode);
The tricky part is the last 3 lines of code, I used the DOM API, not the XML Beans API, to add an XmlObject instance as a child of another XmlObject instance. Also, make sure that the node you import comes from an element that is part of a document, not just a parent-less XmlObject instance (it would be one of those useless XML fragments, frankly that part of the API is counterintuitive.)
The year 2038 problem (also known as “Unix Millennium bug”) will cause problems because time is represented as the number of seconds since January 1, 1970 on Unix and most other systems based on the C programming language. The latest time that a 32-bit system can represent is January 19, 2038.
The electric grid will go down, our toasters will explode, VCRs won’t work, the sewers will overflow, planes will crash!!!!!!! What are we going to do???
Once we’ve survived Y2K38, here comes Y2.07K! It’s hopeless, let’s just give up and go back to stone knives and bearskins.