Sending emails from 1and1 with PHPMailer

 PHP, Sin categor√≠a  Comments Off on Sending emails from 1and1 with PHPMailer
Mar 152015
 

In this post we are going to explain how to send emails using PHPMailer from a 1and1 server.

On the one hand, we have a config.php file where we configure the main parameters.

On the other hand, here you have a sample of a php class using PHPMailer for sending emails.

Parsing XSD Schema files with Java

 XML  Comments Off on Parsing XSD Schema files with Java
Mar 032015
 

Parsing XML is a fairly common task and it is relativily easy because you can use quite a lot of parsers. However, parsing a XSD Schema file is not an easy task. You can parse it as a regular XML, but transform all elements and attributes into java objects are rather difficult. You can use tools, such as XSOM, but it doesn’t seem to be maintained anymore.

As a consequence of that, I decided to develop a proof-of-concept solution using Xerces2. My only goal was to develop a solution that transforms xs:element into XSDElement java objects and xs:attribute into objects XSDAttribute.

In the XSDElements we will save the following data:

and in the XSDAttributtes we will save the following data:

To parse a XSD Schema file using Xerces2 you need to do:

I developed a very simple solution in which I was able to parse only a few elements or only one element and its children. You can find the complete code in GitHub XSDParser repository. With XSDParserTest you can parse an example of XSD Schema file.