XML/XSD Issues, probably simple

I'm trying to use a DOMReader, based much on the one from the one from the tutorial at this site, and am coming up across a SAXParseException talking about "Grammar not found". This has been a particularily frusterating message as no website at least at the top of the search lists refers to the ares of the document in question as "grammar", it seems so strange that SAX does. Anyways, as far as I can tell the program is saying my link to my XSD file is broken, which makes sense because before I implemented the error catcher it was pointing me at an unnamed error on line two, the namespace line. Anyways, I'm sure this is a simple solution but I've been at this for hours, I just can't put my finger on it.
Here's the lines I think are having the trouble. If I'm wrong about them, sorry.
The XML file:
<?xml version="1.0" encoding="UTF-8"?>
<foo xmlns="http://www.example.org/foo" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.example.org/foo schemaFile.xsd">
</foo>And the Schema:
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/foo" xmlns:foo="http://www.example.org/foo" elementFormDefault="qualified">
<element name="foo">
</element>
</schema>Thanks in advance.

I got that error also so I added these lines under declaring the DocumentBuilderFactory factory;
and before starting the builder = factory.newDocumentBuilder();
factory.setAttribute(JAXP_SCHEMA_LANGUAGE,W3C_XML_SCHEMA);
factory.setAttribute(JAXP_SCHEMA_SOURCE,[Insert path to schema here]);
I don't know what your code is but it is worth a try to see if it works.
On a side note I also had
factory.setValidating(true);
factory.setNamespaceAware(true);

Similar Messages

  • Hub and spoke VPN issue - probably simple

    Hello,
    I setup a Hub & Spoke VPN configuration as a temporary solution to get phones working at a client with 5 Sites. 
    Site A: HQ and main PBX System - Cisco ASA 5520
    Sites B-E: Remote Sites with PBX systems with ASA 5505's
    I configured my crypto access-lists to allow all interesting traffic to/from all sites, and it's working for the most part. 
    Refer to this short discussion for further reference
    https://supportforums.cisco.com/message/4162268#4162268
    Recently the customer started saying sometimes the call forwarding between sites isn't working correctly.  Upon further testing, it seems that you have to ping to/from both ends of the Spokes before traffic will start passing through properly.
    E.g.
    Site B wants to talk to Site C
    I need to initiate a ping on Site B to Site C which fails
    Initiate a ping on Site C to Site B and the first packet drops, then the rest go through
    Initiate Ping on Site B to Site C and all works just fine.
    Traffic going to/from Site A to/from any remote site (Sites B-E) works fine 100% of the time.
    This is happening for all remote sites.  When traffic has been initiated on both ends, it works just fine, but after a specific timeout it appears to stop working.
    Probably something simple I'm missing.  Any help is greatly appreciated.
    (Also, kind of silly but I realize that I didn't need same-security-traffic on each spoke, correct?)

    The purpose of doing VPN is that you want 2 or more different networks seamlessly become line 1 common network. Your class B network having 192.168.0.0 and class C networks 192.168.10.0 are in the same network sine both are in the network 192.168.x.x network. Try to consider changing the Class B network into 192.169.0.0 or you can change the Class C network into 192.169.10.0.

  • Help - Set XML /XSD data source at runtime(VC2003)

    The VC 2003 app loads a CR 2008  report without any issue.
    The CR report has an XML/XSD data source ,The spec has now changed to set XML/XSD data source at runtime.
    Anyone have any information /examples on changing a CR report XML data source at runt time in VC IDE. I can not update the app to .Net or port to JAVA ,only stuck with VC 2003.
    Thank you in advance.
    In VC IDE, is there away to set a crystal reports data source as an xml File without to import the xml into a dataset?
    Edited by: Tang Pat on Jan 12, 2009 6:45 AM

    duplicate - please do not post multiple times

  • Converter XSD-XML  &  XML-XSD

    Hi,
    I am looking for a piece of code for
    a) creating an XML file by given an XSD schema
    b) creating an XSD file by given an XML document
    The given files are dynamically.
    The exported files can be good as possible.
    There are many discussions on internet, unfortunatelly without usefull code fragment.
    Is a simple converting of xsd->xml and xml->xsd a big problem?
    (Of course user needs to modify the converted file, so that it makes also semantically sense. )
    Thanks
    Aykut

    Originally posted by: alexm.xxx.yyy
    The Agent Controller is configured with Java 1.5 (I assume, the Window >
    Preferences is the place to do it.) Java 1.6 is not used in my Eclipse
    setup at all.
    Still, the "Java 1.5-" data collector is nowhere to be found.
    For now, I am using The Java Heap Analysis Tool (HAT), which provides
    the object allocation and retention stats, but getting TPTP to work
    would be a much more preferred choice.
    Thanks,
    Alex
    Asaf Yaffe wrote:
    > Alex,
    >> Asaf,
    >>
    >> Thank you for the response. For some reason, my profiler dialog only
    >> shows "Java Profiling - JRE 1.5 or newer..." option in the Monitor tab.
    >>
    >> Do I need to tweak something in my environment to get the JRE 1.5-
    >> entry in the list?
    >
    > Make sure that the Agent Controller (integrated or standalone, depending
    > on your configuration) is configured with a Java 1.5 or 1.4 JVM. If your
    > default environment (Eclipse) is using Java 1.6, then the "Java 1.5-"
    > data collector will not be available.
    >
    >
    >>
    >> Also, how can one get the object references in Java 1.5+?
    >>
    >
    > Sorry, but this capability is not currently supported in our Java 1.5+
    > collector.
    >
    > HTH,
    > Asaf
    >

  • Olympus EM5 - profile issue (probably), raw file example provided

    Olympus EM5 - profile issue (probably)
    raw file in question, posted by somebody in dpreview forum = https://dl.dropbox.com/u/50147350/P8261159.ORF

    As evident from your screenshot, those letters are not blown in raw - there are only a few pixels where one of the channels (blue) is reaching saturation. However, that blue color is very saturated and is mostly falling outside output color space (which is usually sRGB or Adobe RGB) or in other words, your monitor isn't able to display that color
    Conversion from raw color space to output color space is done using profiles and can be colorimetric or perceptual. If conversion is colorimetric, colors outside output color space are simply clamped into the range (for instance RGB  -15, -30, 270 --> 0, 0, 255). If conversion is perceptual, colors that would fall outside color space are compressed into it (for instance it could be  -15, -30, 270 --> 10, 5, 253). In first case, colors inside output color space are 'correct', while those outside are wrong - less saturated and possibly with wrong hue. In the second case, colors outside color space are 'less wrong', but colors inside color space are also 'less correct', but overall result is mostly more pleasing to the eye. This compression is performed differently by each manufacturer.
    Each camera model has own set of profiles. Most simple profile is an 3x3 array named color matrix, used for this color conversion - it is embedded in ACR for all supported cameras and can be also written in raw file. It is colorimetric. Then there is Adobe standard profile for all supported cameras in form of dcp file. It is a combination of matrix and lookup table conversion, which is still close to being colorimetric (however, there are several versions). Other profiles that are emulating camera rendering are perceptual (on some cameras there is also one profile said to be colorimetric, for instance Faithful profile in Canon cameras). Unfortunately, there are no camera profiles for Olympus yet, so colorimetric conversion is the only option (ok, another option is using new version of sRGB profile and its perceptual rendering intent, but it is not possible directly in ACR).
    In this particular case, you can improve the look of those letters by moving saturation slider of blue primary (camera calibration tab) from 0 to about -15, which will modify color matrix used for conversion and desaturate whole blue range. Or do the similar thing with slider in HSL tab
    If PV2010 used, some of blown blue color turns violet. It's also a know issue, actually I also reported it several years ago, and is caused by usage of Photo pro color space as intermediate and some clamping of values in ACR workflow. In this case it may be corrected in calibration tab by moving blue hue slider a bit to left, which will change hues of blue range towards cyan.
    Etc. This area is quite complex, I'm familiar only with a small part of it, which I needed for making camera profiles

  • Macbook pro will not restart to download update instead goes straight to download? macbook pro will not restart to download update instead goes straight to update download probably simple setting prob but i dont know can some on help me i just replaced a

    Macbook pro will not restart to download update instead goes straight to download?
    macbook pro will not restart to download update instead goes straight to update download probably simple setting prob but i dont know can some on help me i just replaced a dieing hard drive and and im running on 08 software pleas help

    i replaced my hard drive and put osz back on now im trying to update but will not update supost to restart then update but instead of restarting it goeses to update and i have to shut it down pleas ignore typos im trippen

  • When we use XML,XSD,WSDL files to create SOA webservices in jdeveloper ,what will happen means internally,how will useful xml ,xsd,wsdl for composite ?

    When we use XML,XSD,WSDL files to create SOA webservices in jdeveloper ,what will happen means internally,how will useful xml ,xsd,wsdl for composite ?
    How xml will send message to XSD then how wsdl interaction then to composite ?

    XSD (XML Schema Definition), is an abstract representation of a XML characteristics.
    The WSDL (Web Services Description Language), describes the functionality offered by your web service.
    You can say what operations your services offers, and describe the messages used for this operations in your XSD.

  • WS-Security and xml.xsd schema

    Hi,
    I am using standard schema that use schemaLocation="http://www.w3.org/2001/03/xml.xsd"
    but my Oracle BPEL PM cannot access internet.
    How can I use those schemas ?? Do i have to get all schemas and include them is the BPEL process??
    What are the best practices for that??
    Thanx
    JO

    Hi, Reply myself ..
    I put all w3c schemas in the bpel/system/xmllib to be accessed as system bpel schemas.
    http://.../orabpel/xmllib/xml.xsd
    Hope it could help someone esle.
    JO

  • 8.1.1.5 Generate XML XSD Schema

    Hi, I'm developing for 8.1.1.5 for generate XML XSD schema and found out there's an option when generating XSD schema in tools wizard to include the length information.
    There's a vanilla BS in 8.0 that i used (EAI XML XSD Generator) to do the same thing as generate schema through tools wizards but now in 8.1.15 i couldn't get the length using the same vanilla BS. Does anyone know how to generate XSD with length information using vanilla BS?

    Please close this thread...it appears that the error occurs when the report involves a big set of records. I tried trying to filter only one record and was able to produce the pdf

  • Dynamic generation of HTML based on XML/XSD

    Hi
    I'm looking for a way to generate HTML from various XMLand/or XSD Files. What I want is a generic mechanism that can generate an HTML page from a random XML/XSD File.
    I have one or two ideas, but I'm interested in what others have done so far.
    Questions:
    - Has anybody already made something like this?
    - Is there some free ware API to support this?
    Thanks!

    you can generated the html dynamically and store it in a ABAP variable and use it in your layout
    but in your case one of the best ways you could handle is store the user selections in an internal table. (which can hold the check box number and an indicator whether that should be rendred or not)
    then in the layout write
    <% loop at itab into wa where render = 'X'. %>
    htmlb:checkbox  id= ....
    <% endloop. %>

  • [svn:fx-trunk] 5844: rename classes (again!) per Ely's last recommendation to avoid XML Library issues

    A new discussion was started by Alex Harui in
    Commits --
    [svn:fx-trunk] 5844: rename classes (again!) per Ely's last recommendation to avoid XML Library issues
    Revision: 5844
    Author: [email protected]
    Date: 2009-04-01 17:59:34 -0700 (Wed, 01 Apr 2009)
    Log Message:
    rename classes (again!) per Ely's last recommendation to avoid XML Library issues
    QE Notes: Rename mustella tests again (please)
    Doc Notes: Update names of classes in documentation.
    tests: checkintests
    Modified Paths:
    April Fool!
    View/reply at
    Replies by email are OK.
    Use the unsubscribe form at
    to cancel your email subscription.

    In the default php.ini is set open_basedir which limits work with php only to few directories (and directories bellow them). There is set /srv/http, /home,/tmp and /usr/share/pear by default.
    To allow your vhost you should add /data/www or set empty value.

  • Issue in Conversion of String to XML (xsd) elements.

    Hi All,
    Please help in resolving the below issue.Please help me ASAP
    I am getting a strng value from Db adapter String= Mike,3453,USA
    I need to convert the data into xml by using below xsd.
    <?xml version="1.0" encoding='UTF-8' ?>
    <schema xmlns="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.uss.com/htr/IHCM204/MainRec"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified"
    xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
    xmlns:tns="http://www.uss.com/htr/IHCM204/MainRec"
    attributeFormDefault="unqualified" nxsd:version="NXSD"
    nxsd:stream="chars" nxsd:encoding="US-ASCII">
    <element name="MainOutput">
    <complexType>
    <sequence>
    <element name="Target" maxOccurs="unbounded">
    <complexType>
    <sequence>
    <element name="name" type="string" nxsd:style="terminated" nxsd:terminatedBy="," />
    <element name="sal" type="string" nxsd:style="terminated" nxsd:terminatedBy="," />
    <element name="add" type="string" nxsd:style="terminated" nxsd:terminatedBy="," />
    </sequence>
    </complexType>
    </element>
    </sequence>
    </complexType>
    </element>
    </schema>
    Regards,
    Ana

    Say, for Example
    If you are getting response from db adapter as abc,def,ghi then use an transform activity to split the string.
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:oraext="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc">
    <xsl:template match="/">
    <ns:StringParsing>
    <ns:Name>
    <xsl:value-of select='substring(/ns:simpleelement/ns:dbString,1.0, oraext:last-index-within-string(/ns:simpleelement/ns:dbString,",") + 0.0)'/>
    </ns:Name>
    <ns:Address>
    <xsl:value-of select='substring(/ns:simpleelement/ns:dbString,oraext:last-index-within-string(/ns:simpleelement/ns:dbString,",") + 2.0)'/>
    </ns:Address>
    </ns:StringParsing>
    </xsl:template>
    </xsl:stylesheet>
    Let me know if it helps you.
    Edited by: BK574 on May 14, 2013 11:31 AM
    Edited by: BK574 on May 14, 2013 11:55 AM
    Edited by: BK574 on May 14, 2013 12:48 PM

  • Jabx xsd to classes and xml marshalling issues due to two namespaces

    Hello everyone,
    I am stack using jaxb and I ask for some help.
    My final objective is being able of marshalling and unmarshalling xml-s that follows the structure of this xsd:
    http://www.ipdr.org/public/VoIP3.5-A.0.1.xsd
    I have already generated the classes with xjc:
         xjc.bat VoIP3.5-A.0.1.xsd
    This generates the following class tree:
    parsing a schema...
    compiling a schema...
    org\ipdr\namespaces\voip\IPDRVoIPType.java
    org\ipdr\namespaces\voip\ObjectFactory.java
    org\ipdr\namespaces\voip\package-info.java
    org\ipdr\namespaces\ipdr\IPDRDoc.java
    org\ipdr\namespaces\ipdr\IPDRDocEnd.java
    org\ipdr\namespaces\ipdr\IPDRType.java
    org\ipdr\namespaces\ipdr\ObjectFactory.java
    org\ipdr\namespaces\ipdr\package-info.java
    Note that if you are behind a proxy and it is not configured it may fail.
    This is fine for now. Next step, I have the following xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Assumptions:
    Call is being made from cell phone to IP
    Call is terminated (normally) by the called side
    Optional and Conditional fields are included based on the type of call made
    Fields that did not include specific values (in the ipdr spec) have been
    populated with information based on SS7 equivalents
    IMSI/ESN/PIN/HLRID values are fictitious -->
    <IPDRDoc xmlns="http://www.ipdr.org/namespaces/ipdr"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.ipdr.org/public/VoIP3.5-A.0.1.xsd"
    IPDRRecorderInfo ="apex.virtualsummit.com"
    version="3.5-A.0.1">
    <IPDR>
    <seqNum>123</seqNum>
    <IPDRCreationTime>2000-02-01T07:00:00Z</IPDRCreationTime>
    <subscriberId>Vendor Phone-1</subscriberId>
    <ipAddress>172.17.17.10</ipAddress>
    <hostName>cisco.gateway.234</hostName>
    <imsiIngress>247478674378574</imsiIngress>
    <esnIngress>33375629401</esnIngress>
    <serviceConsumerType>EU</serviceConsumerType>
    <pin>6294621</pin>
    <startAccessTime>2000-11-25T09:45:30Z</startAccessTime>
    <startTime>2000-11-25T09:45:45Z</startTime>
    <endTime>2000-11-25T10:00:30</endTime>
    <timeZoneOffset>-480</timeZoneOffset> <callDuration>885</callDuration>
    <type>V</type>
    <feature>H</feature>
    <incomingCodec>G711Alaw</incomingCodec>
    <disconnectReason>normalCallClearing</disconnectReason>
    <averageLatency>145</averageLatency>
    <ani>214-924-0258</ani>
    <originalDestinationId>408-830-3711</originalDestinationId> <ipAddressEgressDevice>199.171.210.211</ipAddressEgressDevice>
    <portNumber>17779</portNumber>
    <homeLocationIdIgress>FF01ABD6</homeLocationIdIgress>
    <callCompletionCode>200</callCompletionCode>
    <uniqueCallId>id45678</uniqueCallId>
    </IPDR>
    </IPDRDoc>
    And I have the following classes:
    public class main {
         * @param args
         public static void main(String[] args) {
              Manager mng = new Manager();          
              mng.marshall();
              System.out.println("Agur mundua!");
    And:
    public class Manager {
         public void marshall() {
              try {
                   JAXBContext voip = JAXBContext.newInstance(
                             "org.ipdr.namespaces.voip", this.getClass()
                                       .getClassLoader());
                   Unmarshaller u = voip.createUnmarshaller();
                   // IPDRVoIPType po = (IPDRVoIPType)uvoip.unmarshal( new
                   // FileInputStream("files/example.xml"));
                   // IPDRType po = (IPDRType)uvoip.unmarshal( new
                   // FileInputStream("files/example.xml"));
                   // this implementation is a part of the API and convenient for
                   // trouble-shooting,
                   // as it prints out errors to System.out
                   u
                             .setEventHandler(new javax.xml.bind.helpers.DefaultValidationEventHandler());
                   // IPDRVoIPType structure = (IPDRVoIPType)u.unmarshal( new
                   // FileInputStream(
                   // "D:\\S3Lab-Projects\\Future Internet\\enviroment\\files\\example.xml"
                   JAXBElement<IPDRVoIPType> st = (JAXBElement) u.unmarshal(
                             new StreamSource(new File("files/example.xml")),
                             IPDRVoIPType.class);
                   IPDRVoIPType vtype = st.getValue();
                   System.out.println("ok");
              } catch (JAXBException je) {
                   je.printStackTrace();
    It gives me an exception saying that there are unexpected elements.
    If I use:
    JAXBContext voip = JAXBContext.newInstance(
                             "org.ipdr.namespaces.ipdr", this.getClass()
                                       .getClassLoader());
    JAXBElement<IPDRDoc> st = (IPDRDoc) u.unmarshal(
                             new StreamSource(new File("files/example.xml")),
                             IPDRDoc.class);
                   IPDRDoc vtype = st.getValue();
    I am able to read the attributes of IPDRDoc but not the ones from VoIP.
    My analysis is:
         The xml file is a IPDRDoc with VoIP3.5-A.0.1 elements
         JAXB does not know how to deal with xml that are spitted in various classes
         I cannot change any xsd files because they are standars
    So...
         What can I do to be able to marshall and unmarshall IPDRDoc xml with VoIP attributes generating the java classes from the standard xsd?
    Thank you for your time

    Hello everyone,
    I am stack using jaxb and I ask for some help.
    My final objective is being able of marshalling and unmarshalling xml-s that follows the structure of this xsd:
    http://www.ipdr.org/public/VoIP3.5-A.0.1.xsd
    I have already generated the classes with xjc:
         xjc.bat VoIP3.5-A.0.1.xsd
    This generates the following class tree:
    parsing a schema...
    compiling a schema...
    org\ipdr\namespaces\voip\IPDRVoIPType.java
    org\ipdr\namespaces\voip\ObjectFactory.java
    org\ipdr\namespaces\voip\package-info.java
    org\ipdr\namespaces\ipdr\IPDRDoc.java
    org\ipdr\namespaces\ipdr\IPDRDocEnd.java
    org\ipdr\namespaces\ipdr\IPDRType.java
    org\ipdr\namespaces\ipdr\ObjectFactory.java
    org\ipdr\namespaces\ipdr\package-info.java
    Note that if you are behind a proxy and it is not configured it may fail.
    This is fine for now. Next step, I have the following xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Assumptions:
    Call is being made from cell phone to IP
    Call is terminated (normally) by the called side
    Optional and Conditional fields are included based on the type of call made
    Fields that did not include specific values (in the ipdr spec) have been
    populated with information based on SS7 equivalents
    IMSI/ESN/PIN/HLRID values are fictitious -->
    <IPDRDoc xmlns="http://www.ipdr.org/namespaces/ipdr"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.ipdr.org/public/VoIP3.5-A.0.1.xsd"
    IPDRRecorderInfo ="apex.virtualsummit.com"
    version="3.5-A.0.1">
    <IPDR>
    <seqNum>123</seqNum>
    <IPDRCreationTime>2000-02-01T07:00:00Z</IPDRCreationTime>
    <subscriberId>Vendor Phone-1</subscriberId>
    <ipAddress>172.17.17.10</ipAddress>
    <hostName>cisco.gateway.234</hostName>
    <imsiIngress>247478674378574</imsiIngress>
    <esnIngress>33375629401</esnIngress>
    <serviceConsumerType>EU</serviceConsumerType>
    <pin>6294621</pin>
    <startAccessTime>2000-11-25T09:45:30Z</startAccessTime>
    <startTime>2000-11-25T09:45:45Z</startTime>
    <endTime>2000-11-25T10:00:30</endTime>
    <timeZoneOffset>-480</timeZoneOffset> <callDuration>885</callDuration>
    <type>V</type>
    <feature>H</feature>
    <incomingCodec>G711Alaw</incomingCodec>
    <disconnectReason>normalCallClearing</disconnectReason>
    <averageLatency>145</averageLatency>
    <ani>214-924-0258</ani>
    <originalDestinationId>408-830-3711</originalDestinationId> <ipAddressEgressDevice>199.171.210.211</ipAddressEgressDevice>
    <portNumber>17779</portNumber>
    <homeLocationIdIgress>FF01ABD6</homeLocationIdIgress>
    <callCompletionCode>200</callCompletionCode>
    <uniqueCallId>id45678</uniqueCallId>
    </IPDR>
    </IPDRDoc>
    And I have the following classes:
    public class main {
         * @param args
         public static void main(String[] args) {
              Manager mng = new Manager();          
              mng.marshall();
              System.out.println("Agur mundua!");
    And:
    public class Manager {
         public void marshall() {
              try {
                   JAXBContext voip = JAXBContext.newInstance(
                             "org.ipdr.namespaces.voip", this.getClass()
                                       .getClassLoader());
                   Unmarshaller u = voip.createUnmarshaller();
                   // IPDRVoIPType po = (IPDRVoIPType)uvoip.unmarshal( new
                   // FileInputStream("files/example.xml"));
                   // IPDRType po = (IPDRType)uvoip.unmarshal( new
                   // FileInputStream("files/example.xml"));
                   // this implementation is a part of the API and convenient for
                   // trouble-shooting,
                   // as it prints out errors to System.out
                   u
                             .setEventHandler(new javax.xml.bind.helpers.DefaultValidationEventHandler());
                   // IPDRVoIPType structure = (IPDRVoIPType)u.unmarshal( new
                   // FileInputStream(
                   // "D:\\S3Lab-Projects\\Future Internet\\enviroment\\files\\example.xml"
                   JAXBElement<IPDRVoIPType> st = (JAXBElement) u.unmarshal(
                             new StreamSource(new File("files/example.xml")),
                             IPDRVoIPType.class);
                   IPDRVoIPType vtype = st.getValue();
                   System.out.println("ok");
              } catch (JAXBException je) {
                   je.printStackTrace();
    It gives me an exception saying that there are unexpected elements.
    If I use:
    JAXBContext voip = JAXBContext.newInstance(
                             "org.ipdr.namespaces.ipdr", this.getClass()
                                       .getClassLoader());
    JAXBElement<IPDRDoc> st = (IPDRDoc) u.unmarshal(
                             new StreamSource(new File("files/example.xml")),
                             IPDRDoc.class);
                   IPDRDoc vtype = st.getValue();
    I am able to read the attributes of IPDRDoc but not the ones from VoIP.
    My analysis is:
         The xml file is a IPDRDoc with VoIP3.5-A.0.1 elements
         JAXB does not know how to deal with xml that are spitted in various classes
         I cannot change any xsd files because they are standars
    So...
         What can I do to be able to marshall and unmarshall IPDRDoc xml with VoIP attributes generating the java classes from the standard xsd?
    Thank you for your time

  • Probably Simple XML toString

    I've been trying to convert an xml document to a string, but I'm having a problem converting. I'm reading the XML from a file.
    Document document = builder.parse(new File(filename));
    And I'm sure that works. I can parse the result. But then I try to return what I've read using:
    return (document.toString());
    Every attempt I've made at using toString() has failed; even when I just try to write it out. What's the trick?

    I don't think that is right way of doing it, try it out this way:
    Document document;
    TransformerFactory tFactory =
                    TransformerFactory.newInstance();
                            Transformer transformer = tFactory.newTransformer();
                DOMSource source = new DOMSource(document);
                StringWriter sw=new StringWriter();
                StreamResult result = new StreamResult(sw);
                transformer.transform(source, result);
    String xmlString=sw.toString();Message was edited by:
    java_queen

  • Framemaker XML Output Issue

    I have an issue with an attribute not being exported to XML from FM8.
    Here is the excerpt from the DTD:
    <!ELEMENT std.table.header (std.table.row+)>
    <!ATTLIST std.table.header
      cols CDATA #REQUIRED
      rowsep CDATA "1"
    >
    The first issue I had was "cols" not showing up as an attribute in the Structured View. I solved with issue (with the help of MarttiP) by adding it to the EDD as shown below:
    Element (Container): std.table.header
    General rule: std.table.row+
    Attribute list
    Name: cols  Integer  Required
    Now the issue I am having is on export of the XML, the "cols" attribute is not being exported and I am getting an error "required attribute 'cols' not provided". Any suggestions?

    The std.table.header element will need to be mapped to a new table structure in FrameMaker. While FrameMaker handles CALS tables without the need for additional read/write rules, you will have to provide a full set of rules to create the correct FrameMaker table mapping.
    The std.table.header is only a part of a table, it's used in many places as the header for a variety of non-CALS tables. For each of these tables you will need to define a new FrameMaker table structure. I'll attempt to provide the solution for the first of these special tables...
    In the DTD the following structure is defined:
    <!ELEMENTaal (title, std.table.header, (aal-category+ | aal-entry+))>
    <!ATTLISTaal
      %frameatt;
    >
    <!ELEMENTaal-category (title, aal-entry+)>
    <!ATTLISTaal-category
      %frameatt;
    >
    <!ELEMENTaal-entry (nsn+, dcpno, ui, qty)>
    <!ATTLISTaal-entry
      %bodyidatt;
    >
    The aal element is probably intended to be displayed as a table. The std.table.header must be fitted into a suitable structure for FrameMaker, for example:
    In this example new FM table part elements have been added to the EDD to provide the required table structure. On import from XML FrameMaker will create the missing elements, Read/Write rules must be used to drop them on export. The table parts used in the example are:
    Element name
    FM element type
    aal
    Table
    std.table.header.title
    Table title
    std.table.header
    Table header
    std.table.header.row
    Table row
    std.table.header.entry
    Table cell
    aal.table.body
    Table body
    aal-category
    Table row
    entry.title
    Table cell
    aal-entry
    Table cell
    nsn, dcpno, ui, qty
    Container
    You may ask whether it's worth putting this much effort into formatting data as tables, in this example maybe not, but there will be times when it's the only way to go.
    One of the problem areas are elements that have to be defined as different FM element types depending on context. In this example aal/title has to be reneamed to std.table.header.title and aal-category/title is renamed to entry.title. I would use XSLT to transform the elements on XML import and export.
    The easier alternative t all of this is to forget about using tables and format the data as simple lists.
    I hope this has been useful.
    Regards
    Ian

Maybe you are looking for

  • No Clue Where This Is Suppose To Go. Camera, iPhoto, USB. Have Fun.

    I got a new digital camera a few months ago and my MacBook Pro would pick up the camera just fine using iPhoto and I could upload the pictures on to my computer no problem. Now, not the case. Now when I hook up the camera to my computer with the USB

  • SCSM R2 Duplicate Email Notifications

    Hello anyone! I recently installed SCSM R2 on Windows Server 2012 R2 and created my Service Manager environment. I incorporated an Active Directory connector so I could notify affected users and assigned users of incident creation, assignment and res

  • Crystal Reports XI R2 Appcrash in Vista but OK in XP

    I have a Windows Form VB.NET application using Crystal XI R2 to produce reports. The application works flawlessly on other machines in Windows XP, but as soon as I try to load a report in Vista the program exits with the following message - Descripti

  • ODBC driver hangs for two table joining

    Hi, I was trying to access two tables with the following statements. I used Oracle 8 ODBC driver to access Oracle 9 database. Statement 1 and 2 are working fine but executing Statement 3 will hangs the program. Statement1: SELECT (fields from two tab

  • How can i fetch records from 3 tables in a single query  without using join

    Hi. Can any body please tell me <b>How can i fetch records from 3 tables with a single query  without using joins</b> Thanx prabhudutta