Results 1 to 4 of 4
  1. #1
    patilsubh is offline Member
    Join Date
    Feb 2009
    Posts
    2
    Rep Power
    0

    Default Need help for creating executable xml

    hi

    i have xml with dtd as given below

    <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
    <!DOCTYPE TRAVELLINEDOCUMENT [
    <!ELEMENT TRAVELLINEDOCUMENT (TRAVELANDEXPENSE | TRAVELRESOURCE)+>

    <!ELEMENT TRAVELANDEXPENSE (HEADER?, FOOTER?, DOCUMENTHEADER?, CONTENT)>
    <!ATTLIST TRAVELANDEXPENSE
    LANGUAGEID CDATA #REQUIRED
    ORIENTATION (PORTRAIT | LANDSCAPE) #REQUIRED
    PAGEBORDER (NONE | TOP | BOTTOM | TOPBOTTOM | ALL | BOX | COLBOTTOM | COLTOP | COLTOPBOTTOM | COLUMNS) #REQUIRED
    MARGINLEFT CDATA #REQUIRED
    MARGINRIGHT CDATA #REQUIRED
    MARGINTOP CDATA #REQUIRED
    MARGINBOTTOM CDATA #REQUIRED
    MARGINHEADER CDATA #REQUIRED
    MARGINFOOTER CDATA #REQUIRED
    LINESPACING CDATA #REQUIRED
    FONT CDATA #REQUIRED
    FONTSIZE CDATA #REQUIRED
    FONTBOLD (TRUE | FALSE) #REQUIRED
    FONTITALIC (TRUE | FALSE) #REQUIRED
    FONTUNDERLINE (TRUE | FALSE) #REQUIRED
    TEXTCOLOR CDATA #REQUIRED
    BACKCOLOR CDATA #REQUIRED
    FORMATSHORTTIME (TRUE | FALSE) #REQUIRED
    TABLEBORDER (NONE | TOP | BOTTOM | TOPBOTTOM | ALL | BOX | COLBOTTOM | COLUMNS) #REQUIRED
    >

    <!ELEMENT HEADER (LINE)>
    <!ATTLIST HEADER>

    <!ELEMENT FOOTER (LINE)>
    <!ATTLIST FOOTER>

    <!ELEMENT CONTENT (BARCODE | PICTURE | TABLE | LINE | LINECONDITION | NEWPAGE)*>
    <!ATTLIST CONTENT>

    <!ELEMENT DOCUMENTHEADER (PICTURE | LINE | BARCODE | LINECONDITION)*>
    <!ATTLIST DOCUMENTHEADER>

    <!ELEMENT BARCODE EMPTY>
    <!ATTLIST BARCODE
    TOP CDATA #REQUIRED
    HEIGHT CDATA #REQUIRED
    LEFT CDATA #REQUIRED
    WIDTH CDATA #REQUIRED
    ORIENTATION (HORIZONTAL | VERTICAL) #REQUIRED
    TYPE (0 | 1 | 2) #REQUIRED
    CONTENT CDATA #REQUIRED
    >

    <!ELEMENT PICTURE EMPTY>
    <!ATTLIST PICTURE
    TOP CDATA #REQUIRED
    HEIGHT CDATA #REQUIRED
    LEFT CDATA #REQUIRED
    WIDTH CDATA #REQUIRED
    SOURCE CDATA #REQUIRED
    >
    <!ELEMENT TABLE ((TABLEHEADER+) | (LINE+) | (TABLEHEADER+ , LINE+) | (TABLEHEADER+ , MULTILINE) | (MULTILINE)| (TABLEHEADER+ , MULTILINE, LINE+)| (LINECONDITION))>
    <!ATTLIST TABLE
    TYPE CDATA #REQUIRED
    IDTEXTMODULE CDATA #IMPLIED
    SORT CDATA #IMPLIED
    READNEW CDATA #IMPLIED
    KINDOFCOST CDATA #IMPLIED
    TABLEHEADERNEWPAGE CDATA #IMPLIED
    >

    <!ELEMENT TABLEHEADER (COLUMN+)>
    <!ATTLIST TABLEHEADER
    FONTSIZE CDATA #IMPLIED
    FONTBOLD (TRUE | FALSE) #IMPLIED
    FONTITALIC (TRUE | FALSE) #IMPLIED
    FONTUNDERLINE (TRUE | FALSE) #IMPLIED
    TABLEBORDER CDATA #IMPLIED
    >

    <!ELEMENT LINE (COLUMN+ | CONDITION)*>
    <!ATTLIST LINE
    FONTNAME CDATA #IMPLIED
    FONTSIZE CDATA #IMPLIED
    FONTBOLD (TRUE | FALSE) #IMPLIED
    FONTITALIC (TRUE | FALSE) #IMPLIED
    FONTUNDERLINE (TRUE | FALSE) #IMPLIED
    TABLEBORDER CDATA #IMPLIED
    >

    <!ELEMENT LINECONDITION (TRUE | FALSE | (TRUE , FALSE) | TABLE | LINE+ | MULTILINE | COLUMN | EMPTY)>
    <!ATTLIST LINECONDITION
    VALUE CDATA #REQUIRED
    >

    <!ELEMENT COLUMN (#PCDATA | CONDITION | EXECUTE )*>
    <!ATTLIST COLUMN
    FONTSIZE CDATA #IMPLIED
    FONTBOLD (TRUE | FALSE) #IMPLIED
    FONTNAME CDATA #IMPLIED
    FONTUNDERLINE (TRUE | FALSE) #IMPLIED
    BACKCOLOR CDATA #IMPLIED
    TEXTCOLOR CDATA #IMPLIED
    WIDTHINCHARS CDATA #IMPLIED
    WIDTHINTWIPS CDATA #IMPLIED
    ALIGN (LEFT | CENTER | RIGHT) #REQUIRED
    DECIMALPLACES CDATA #IMPLIED
    NULLVALUE (TRUE | FALSE) #IMPLIED
    IDTEXTMODULE CDATA #IMPLIED
    >

    <!ELEMENT MULTILINE (LINE+ | LINECONDITION | TABLE)*>

    <!ELEMENT CONDITION (TRUE | FALSE | (TRUE , FALSE) | EMPTY)>
    <!ATTLIST CONDITION
    VALUE CDATA #REQUIRED
    >

    <!ELEMENT TRUE (#PCDATA | COLUMN | LINE | CONDITION | EXECUTE | NEWPAGE | TABLE | LINECONDITION)*>

    <!ELEMENT FALSE (#PCDATA | COLUMN | LINE | CONDITION | EXECUTE | NEWPAGE | TABLE | LINECONDITION)*>

    <!ELEMENT EXECUTE (#PCDATA | EMPTY)*>
    <!ATTLIST EXECUTE
    VALUE CDATA #IMPLIED
    >

    <!ELEMENT NEWPAGE (#PCDATA)*>
    <!ATTLIST NEWPAGE
    ORIENTATION (PORTRAIT | LANDSCAPE) #REQUIRED
    PAGEBORDER (NONE | TOP | BOTTOM | TOPBOTTOM | ALL | BOX | COLBOTTOM | COLTOP | COLTOPBOTTOM | COLUMNS) #REQUIRED
    MARGINLEFT CDATA #REQUIRED
    MARGINRIGHT CDATA #REQUIRED
    MARGINTOP CDATA #REQUIRED
    MARGINBOTTOM CDATA #REQUIRED
    MARGINHEADER CDATA #REQUIRED
    MARGINFOOTER CDATA #REQUIRED
    LINESPACING CDATA #REQUIRED
    FONT CDATA #REQUIRED
    FONTSIZE CDATA #REQUIRED
    FONTBOLD (TRUE | FALSE) #REQUIRED
    FONTITALIC (TRUE | FALSE) #REQUIRED
    FONTUNDERLINE (TRUE | FALSE) #REQUIRED
    TABLEBORDER (NONE | TOP | BOTTOM | TOPBOTTOM | ALL | BOX | COLBOTTOM | COLUMNS) #REQUIRED
    >
    ]>
    <TRAVELLINEDOCUMENT>
    <TRAVELANDEXPENSE LANGUAGEID="de" ORIENTATION="PORTRAIT" PAGEBORDER="NONE" MARGINLEFT="900" MARGINRIGHT="600" MARGINTOP="600" MARGINBOTTOM="800" MARGINHEADER="0" MARGINFOOTER="1200" LINESPACING="100" FONT="Arial" FONTSIZE="10" FONTBOLD="FALSE" FONTITALIC="FALSE" FONTUNDERLINE="FALSE" TEXTCOLOR="BLACK" BACKCOLOR="WHITE" TABLEBORDER="NONE" FORMATSHORTTIME="TRUE">
    <HEADER>
    <LINE FONTSIZE="9" FONTBOLD="TRUE">
    <COLUMN WIDTHINCHARS="" WIDTHINTWIPS="3500" ALIGN="LEFT"></COLUMN>
    <COLUMN WIDTHINCHARS="" WIDTHINTWIPS="3000" ALIGN="CENTER"></COLUMN>
    <COLUMN WIDTHINCHARS="" WIDTHINTWIPS="3500" ALIGN="RIGHT"></COLUMN>
    </LINE>
    </HEADER>
    <FOOTER>
    <LINE FONTSIZE="9" FONTBOLD="TRUE">
    <COLUMN WIDTHINCHARS="" WIDTHINTWIPS="8000" ALIGN="LEFT">Reise-Nr.: #travel.TravelNumber#</COLUMN>
    <COLUMN WIDTHINCHARS="" WIDTHINTWIPS="1000" ALIGN="CENTER"> </COLUMN>
    <COLUMN WIDTHINCHARS="" WIDTHINTWIPS="1500" ALIGN="RIGHT">#Seite -%d-#</COLUMN>
    </LINE>
    </FOOTER>
    <DOCUMENTHEADER>
    <LINE>
    <COLUMN FONTSIZE="7" FONTBOLD="FALSE" WIDTHINCHARS="" WIDTHINTWIPS="10000" ALIGN="LEFT"> </COLUMN>
    </LINE>
    <!--MAD 20091001 Ämderung LOGO-->
    <!--PICTURE TOP="400" LEFT="8500" HEIGHT="600" WIDTH="1950" SOURCE="adplogo_neu.gif"/-->
    <PICTURE TOP="400" LEFT="8500" HEIGHT="600" WIDTH="1400" SOURCE="ADP.jpg"/>
    <LINE>
    <COLUMN FONTSIZE="14" FONTBOLD="TRUE" WIDTHINCHARS="" WIDTHINTWIPS="10000" ALIGN="LEFT">
    <CONDITION VALUE="(!= '#travel.NumberOfAccountings#' '0')">
    <TRUE>
    <CONDITION VALUE="(== '#AccountingUser.AccountingDate#' '')">
    <TRUE>Reisekostenabrechnung</TRUE>
    <FALSE>Reisekostenabrechnung vom #AccountingUser.AccountingDate#</FALSE>
    </CONDITION>
    </TRUE>
    <FALSE>#travel.DescriptionType# #travel.DescriptionStatus#</FALSE>
    </CONDITION>
    </COLUMN>
    </LINE>
    <LINE>


    now i want write some code which identifies tags like <CONDITION></CONDITION> as given above and then as per condition fill the value and convert it into xml . please help

  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    10

    Default

    Your thread topic is strange. Executable XML file?
    You could read the XML using one of the XML parsing APIs or simply extract the tags using regex. Both require a bit of reading. On your part.

  3. #3
    patilsubh is offline Member
    Join Date
    Feb 2009
    Posts
    2
    Rep Power
    0

    Default

    yep,
    i have different tags like <condition> and as per tag i have to fill value in xml like
    <CONDITION VALUE="(!= '#travel.NumberOfAccountings#' '0')">
    <TRUE>
    <CONDITION VALUE="(== '#AccountingUser.AccountingDate#' '')">
    <TRUE>Reisekostenabrechnung</TRUE>
    <FALSE>Reisekostenabrechnung vom #AccountingUser.AccountingDate#</FALSE>
    </CONDITION>
    </TRUE>
    <FALSE>#travel.DescriptionType# #travel.DescriptionStatus#</FALSE>
    </CONDITION>

    so is there any api for that. i have read velocity and jelly but i think its not usable here.
    do you think regex will help me? please reply

  4. #4
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    10

    Default

    Quote Originally Posted by r035198x
    you could read the xml using one of the xml parsing apis or simply extract the tags using regex. Both require a bit of reading. On your part.
    . .

Similar Threads

  1. Replies: 3
    Last Post: 08-10-2009, 06:34 AM
  2. executable jar with images
    By tascoa in forum Eclipse
    Replies: 3
    Last Post: 05-05-2009, 12:06 PM
  3. creating executable jars from Swing programs
    By gotenks05 in forum New To Java
    Replies: 2
    Last Post: 09-19-2008, 01:51 AM
  4. executable
    By smooth in forum New To Java
    Replies: 4
    Last Post: 06-14-2008, 05:12 PM
  5. Executable JAR
    By bugger in forum New To Java
    Replies: 4
    Last Post: 12-05-2007, 06:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •