Problem in the evaluation of the XPath in xml using java.

Hello

I wrote a method to evaluate the xpath expression and returns the result in the string 'true' or 'false' or 'anyValue as in the xpath expression.

for example:

< k >
< g > 1 / < g >
< c >! / < c >
< /k >
< k >
< g > 2 / < g >
< c > # </c >
< /k >

< k >
$ < c >/< c >
< /k >

If the xpath expression is /k [g / text () = '1'] / c/text () = "#"-the code returns false

Similarly /k [g / text () = '1'] / c/text () ='! ' - returns true

But in the flow of my project, we have removed the xml node that contains no data. Thus, the last < k > tag is not have < g >. then, East - wat I think

If the xpath expression is /k [g / text () = "] / c / text () = ' $' should return true. but since there is no < g > tag, it returns false. But, by the logic of my project, g is there, but the bcz removed its null...

Pls help me with this...

Thank you
Sabarisri. N

Edited by: Sabarisri N November 11, 2011 16:33

Edited by: Sabarisri N November 11, 2011 16:35

The criteria for the return of true or false is not clear as the three bodies that are specific. To take account of these three cases, the xpath expression can be very restrictive in look like that. By way of illustration, I put it in a knot xsl or xsl: When, use tests, assuming the context node to be the parent of the node k.


Because the conditions are specific, it seems inevitably awkward due to the need of the enumeration of the case-by-case basis.

Tags: Oracle Development

Similar Questions

  • my iPhone 6s has problems with the GPS when I use some applications, it does not work well and give especially the bad road. Can someone help me?

    my iPhone 6s has problems with the GPS when I use some applications, it does not work well and give especially the bad road. Can someone help me?

    My iphone 6 has started having the same problem. Its literally the GPS. Saying that it does not find me at all. Ive seen say location for more than an hour in the suburbs of chicago. It started to happen to me after I downloaded the latest update for the iphone. I hope they react and let you know what is happening because I'm dying to know as well.

  • I use LR cc and when I try to use the feature up, I get a message back indicating that "no connection found Upgright". I do not have ' had this problem in the past. IM using Windows 10 and I used a Canon 7 d Mark II with an II Canon 24-70 lens. No idea wh

    I use LR cc and when I try to use the feature up, I get a message back indicating that "no connection found Upgright". I have not had this problem in the past. IM using Windows 10 and I used a Canon 7 d Mark II with an II Canon 24-70 lens.

    It simply means that it cannot find enough information in the image to apply a correction. Have you tried to apply a profile and then using the vertical transformation.

  • the formatting generated XML using XMLELEMENT() my output approximates to a single line, I want to be in an XML format

    Hi I have a problem in the formatting of XML file, that I generated with xmlelement() when I run it gives me putput in one line

    is it possible that I got my output as an XML file...

    This is the expected behavior. PRETTY print (ing) is required for humans. XML parsers do not need XML to be pretty printed. If you open the XML file in a browser such as Windows Explorer or Firefox, the browser will display enough output for you.

    In all, the exit 'single line' is made for PERFORMANCE reasons (lack of useless end of line and CTRL line breaks etc.)

    SELECT xmlelement ("employee name", model ") as"RESULT XML.

    FROM DUAL;

    X

    SELECT xmlelement ("employee name", xmlelement ("name", false))

    , xmlelement ("LastName", dummy)

    ) as "RESULT XML.

    FROM DUAL;

    X X

    XMLSERIALIZE enough to print the result if necessary via indentation

    SELECT XMLSERIALIZE (SIZE of withdrawal CONTENT xmlelement ("Employee Name", xmlelement ("name", model), xmlelement ("LastName", false)) as CLOB = 1).

    FROM DUAL;

    X

    X

  • Download the client computer name using java or javascript

    Hi guru,.

    ... JDev 11.1.2.4.0...

    I don't have any application in the ADF and I want to get the client computer name using java or javascript. I searched on this, but I have found that this javascript method

    function getWorkstationID() {var ax = new ActiveXObject ("WScript.Network"); alert (ax.ComputerName); }

    but that use ActiveX that only work in IE with some security configurations, and I want to get the computer name of any browser client.

    Can you please help me to get the client computer name?

    Try one of these 2 ways:

          HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
          String computerName = request.getRemoteHost();
    

    or

          HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
          InetAddress i = InetAddress.getByName(request.getRemoteAddr());
          String computerName =  i.getHostName();
    
  • IR hotsync problem: "because the port is in use by another application."

    I finally got my system operation.  Sony Clie TJ - 25 pda, Palm Desktop 4.1, Windows 7 64 bit.  Very delicate balance.  I failed to install the new software released by aceeca.  I finally got it by infrared hotsync.  Several times.

    Now, today, I get the message on the Clie: "could not start the hotsync operation because the port is in use by another application."

    I saw this thread and in fact ensure that the transfer of images using a digital camera box is unchecked.  It still does not.  The icon hotsync in the lower right part of the screen, when I check that IR is checked, nothing else is.  It still does not.

    Thoughts?  Ideas?  Suggestions?

    Cidercat I had this happen to me with bluetooth hotsync before. I listen to radio, transfer files and surf the web with bluetooth. I could solve the problem by turning off the bluetooth, then turn it back on. Sometimes a warm reboot might also work. I came across a free application for the Palm tree named NetworkDown. It closes completely all active sessions down. You type right on the icon to run it. It works on my TX.

    http://www.metaviewsoft.de/en/software/PalmOS/freeware/other/NetworkDown.PRC

  • Problem with the loading of XML and xmlns

    I'm having a problem with loading an XML file that was created by Filemaker.  FileMaker will display an XML file by using one of two different grammars.  A poster of a standard form for the most that I can use with a glitch.  Flash CS4 AS3 seems to have a problem with the xmlns in one of the nodes.

    More precisely:

    " < FMPDSORESULT xmlns =" http://www.FileMaker.com/fmpdsoresult "> "

    ' If I remove the xmlns = " http://www.FileMaker.com/fmpdsoresult 'the file is loaded properly and I can access the different fields without problem.  However, when I go the xmlns =..., it will trace the XML properly but I can't access the fields by using the code below.  It drives me crazy!

    With part xmlns in the XML file, I get the following error when attempting to load the thumbnails files:

    TypeError: Error #1010: a term is undefined and has no properties.

    I need it so that the user can enter/change the data and simply output the XML file of Filemaker and then the Flash load the XML file not corrupted and displays the information requested by the user.  That is to say I might have the user open the XML file in a word processing application and have remove them the xmlns..., but it is rather heavy and not very user-friendly.

    I tried all the xml.ignore functions I could find, but it does not help.  I hope someone out there can help you

    Thank you

    -Brand-

    _____________________________________________________________________________________

    Partial XML:

    XML to export Filemaker:

    <? XML version = "1.0" encoding = "UTF-8"? >
    <! - this grammar has been deprecated - use the FMPXMLRESULT instead.
    " < FMPDSORESULT xmlns =" http://www.FileMaker.com/fmpdsoresult "> "
    < ERRORCODE > 0 < / ERRORCODE >
    Sport.FP7 < DATABASE > < / DATA >
    < LAYOUT > < / PAGE layout >
    < LINE MODID = '1' RECORDID = "1" >
    Brand of < FirstName > < / name >
    Fowle < name > < / LastName >
    Veil of < sport > < / Sport >
    Medal of <>no < / medal >
    Design of < CourseOfStudy > < / CourseOfStudy >
    < year > 1976-1978 < / year >
    California < HomeState > < / HomeState >
    < ImageName > 93 < / ImageName >
    < / ROW >

    ...

    < / FMPDSORESULT >

    __________________________________________________________________________________

    AS3 code:

    Import fl.containers.UILoader;
    var aPhoto: Array = new Array(ldPhoto_0,ldPhoto_1,ldPhoto_2,ldPhoto_3,ldPhoto_4,ldPhoto_5);
    var toSet:int = 10; time to time delay
    var toTime:int = place;
    var photoPerPage:int = 6;
    var fromPos:int = photoPerPage;
    var imgNum:Number;

    var subjectURL:URLRequest = new URLRequest ("testData_FM8.xml");
    var subjectURL:URLRequest = new URLRequest ("Sports.xml");
    var xmlLoader:URLLoader = new URLLoader (subjectURL);
    xmlLoader.addEventListener (Event.COMPLETE, xmlLoaded);
    var subjectXML:XML = new XML();
    subjectXML.ignoreWhitespace = true;
    subjectXML.ignoreComments = true;
    subjectXML.ignoreProcessingInstructions = true;

    function xmlLoaded(evt:Event):void {}
    subjectXML = XML (xmlLoader.data);

    If {(root.loaderInfo.bytesTotal is root.loaderInfo.bytesLoaded)
    removeEventListener (Event.ENTER_FRAME, xmlLoaded);
    trace ("data XML file loaded");
    trace (subjectXML);
    } else {}
    trace ("file not found");
    }
    imgNum=2;//subjectXML.ROW.length;
    trace (subjectXML);
    loadThumb (0);
    }
    function loadThumb(startPos:int):void {}
    var count:Number = aPhoto.length;
    trace (subjectXML.Database);
    for (var i = 0; i < count; i ++) {}
    try {}
    aPhoto[i].source="images/"+subjectXML.ROW[startPos+i]. ImageName + "_main.jpg";
    } catch (error) {}
    trace (e);
    }
    aPhoto [i] .mouseChildren = false;
    aPhoto [i] .addEventListener (MouseEvent.MOUSE_DOWN, onThumbClick);
    }
    trace ("current mem:" + System.totalMemory);
    ldAttract.visible = false;

    }
    function unloadThumb (): void {}
    var count:Number = aPhoto.length;
    for (var i = 0; i < count; i ++) {}
    aPhoto [i] .unload ();
    aPhoto [i] .removeEventListener (MouseEvent.MOUSE_DOWN, onThumbClick);
    }
    trace ("current mem:" + System.totalMemory);

    }

    function onThumbClick(evt:MouseEvent) {}
    var i: Number;
    trace ("Thumbnail clicked" + evt.target.name);
    i = findPos (evt. Target.Name);
    ldLrgPhoto.source="images/"+subjectXML.ROW[i+fromPos]. LOCAL_OBJECT_ID + "_main.jpg";
    ldLrgPhoto.visible = true;
    btnPrev.visible = false;
    btnNext.visible = false;

    gotoAndStop ("showPhoto");
    }
    function findPos(thumb:String):Number {}
    var pos:Number;
    var count:Number = aPhoto.length;
    for (var i: Number = 0; i < count; i ++) {}
    If (thumb == aPhoto [i] .name) {}
    POS = i;
    }
    }
    return pos;
    }

    Mark,

    The ':' is what we call a scope resolution operator. Using namespace allows you to potentially have two or more nodes that have the same name but a namespace 'different '. "These are normally specified in xml in the form xmlns:mynamespace ="http://myuniqueURI.com/etc"

    Normally, you would use the mynamespace:node by naming your xml nodes that are specific to this namespace.

    But the best is that namespace by default, when there is no real Prefixeespacenom: in the name of node as:

    That's how it is specified in your xml file, that is to say all the nodes without a prefix belong to the filemaker namespace.

    In actionscript, you navigate by using the scope-resolution operator and the variable that represents the namespace does not necessarily resemble the part "mynamespace" above. In your case the namespace used was the one by default (no), but a value has been assigned.

    To the question of the length, you must use the length() method, otherwise the e4x filtering seeks nodes named 'length' and creating a XMLList with no entry in there (because it's not). It is a common thing with other "Properties" that are expressed in the form of methods like children() and often take me when I started with the model XML as3.

  • Problem with the installation of application using the OTA of the Tomcat server

    Hello

    I want to install my server application Tomcat suppose that here is the link to the example

    http://121.00.00.00:8080 / Web JSP project/Myapp.jad

    as he tried the link above in the Blackberry browser I get java.io.IOException as myapp - 1.cod not found...

    I placed the .jar, .jad, .cod in the folder web in the netbeans IDE and deployed in normal Office Internet explore if I click on the file link at the above address .jad opens for download where as Blackberry browser, I get an exception...

    can someone tell me how can I get it in the browser blackberry also...

    Kind regards

    Kiran

    You must only place a .jad and .cod on the server.

    However if .cod exceeds 64 k, it becomes an archive, you'll need to extract all the separate .cod files and place them in the same folder as the original .cod

    For example, you have MyApp.cod. Decompress and extract MyApp - 1.cod, MyApp - 2.cod

  • Create the new virtual machine using Java API vCloud

    Hi guys,.

    I am trying to create the new virtual machine in TIME, but I've stuck here. The API I'm using is vcloud-java-sdk - 1.0.jar.

    Could you please show me a code snippet how to do this?

    For now I do it like this:

    RecomposeVAppParamsType recomposeVAppParamsType = new RecomposeVAppParamsType();

    List the items < CompositionItemParamType > = recomposeVAppParamsType.getItem ();
    ReferenceType vappTemplateVMRef = new ReferenceType();

    // ??? seems that new reference to the new virtual machine should be here. But how to create this VM
    CompositionItemParamType compositionItemParamType = new CompositionItemParamType();
    compositionItemParamType.setSource (vappTemplateVMRef);

    Items.Add (compositionItemParamType);
    ReferenceType vAppRef is Vdc.getVdcByReference (vcloudClient, vdcRef) .getVappRefByName ("vApp_Websrv");.

    Vapp.getVappByReference (vcloudClient, vAppRef) .recomposeVapp (recomposeVAppParamsType);

    One day before I played with Web Services SDK, which is much easier to understand. I was able to create the vApp and VMs in vSphere. Is it possible to import machines virtual vSphere to vCloud? Should what API I use for this?

    Thank you

    Hello

    You cannot add a new empty virtual machine in a paralytic.

    Instead, you can add a virtual machine from an existing vapp, vapptemplate.

    To import a vsphere vm to vcloud.

    Import vsphere vm as VAPP in vcloud. VMWVimserver-> importVmAsVApp()

    The importation of vsphere vm, as vAppTemplate, in vcloud. VMWVimserver-> importVmAsVAppTemplate()

    See also the example of ImportVmAsvAppTemplate.java, which is part of the vcloudjavasdk group.

    Kind regards

    Rajesh Kamal.

  • How to filter the doc and xml using SDKFileOpenChooser?

    I need to filter only word and xml

    SDKFileOpenChooser openChooser;

    openChooser.AddFilter (291, "App_Filter");   291 for app

    openChooser.ShowDialog ();


    Where to find the ID of the extension for the filter application or any solution?

    To display only the XML using SDKFileOpenChooser files use:

    openChooser.AddFilter (kXMLFileTypeInfoID, "files (xml)" "") XML;

    To Word files, try to use kMSWordFileTypeInfoID instead.

  • I installed the latest version of Firefox and it does not connect to any Web site. I had no problem with the previous version, I used.

    Can not connect to any Web site.

    texhusky Hello, normally these problems are caused by a security/firewall software which does not recognize and therefore blocks the new versions of firefox. If please delete all the rules of the program for firefox to your firewall and let it detect the new version of the browser again.

    Difficulty of problems connecting to websites after Firefox update

  • Problem reading the worksheet after you use a DLL to write on the worksheet

    Hello

    I have a few problems reading a sheet DLL created in LabVIEW. The DLL is written in C++.

    I'll dexcribe what do the VI in the screenshots:

    For DLL_INIT = the first false steps the VI (LabVIEW) values and exports in a DLL initialization.
    DLL takes these values and not some und calculation, then wrote the measured values and the new calculated values in a csv file called 'filtered_values' and a file 'filtered_values_complete '.
    so, I have two files like this after initialization:

    1.0000000000; 1.0000000000; 18.8991610737; -3.2940000000; 0.0060000000; 0.9000000000; 6.5806287097; -3.2940000000; 1.0000000000; 0.0000000000; 1.0000000000; 0.0000000000;

    So now on DLL_INIT = true.
    For the calculation, the next step i read the "filtered_values" - file (LabVIEW), calculate the new values and write in filtered_values (DLL)
    And in the "filtered_values_complete" - file I will allways read the DLL entry first, so that I can check later, if the DLL has obtained the values to the right of the front step and then add the calculated values.

    For i > 0 initialization has been made:
    -the VI bed sheet "filtered_values" calculation and rotted the table 1 d in its unique values
    -The last seven values in the worksheet have been exported in the dll as well as five new measured values.
    -This DLL is still a few calculation
    - then it replaces the "filtered_values" - file and adds a new line to the 'filtered_values_complete '.

    This migth be a bit of confusion, so a small example, afer five steps it loooks like this:

    filtered_values:
    5.0625000000; 1.0000000000; 18.9300200447; -3.2870000000; 9.7320000000; 0.8997597592; 5.9159054233; -2.6533532901; 1.0000000400; 0.0000000000; 0.8078703403; 0.0000000000;

    filtered_values_complete:
    1.0000000000; 1.0000000000; 18.8991610737; -3.2940000000; 0.0060000000; 0.9000000000; 6.5806287097; -3.2940000000; 1.0000000000; 0.0000000000; 1.0000000000; 0.0000000000;
     
    2.0625000000; 1.0000000000; 18.8330081064; -3.2940000000; 9.7270000000; 0.9000000000; 6.5806287097; -3.2940000000; 1.0000000000; 0.0000000000; 1.0000000000; 0.0000000000;
    2.0625000000; 1.0000000000; 18.8330081064; -3.2940000000; 9.7270000000; 0.8999399568; 6.4077416273; -3.1451829134; 1.0000000100; 0.0000000000; 0.9480589053; 0.0000000000;
     
    3.0625000000; 1.0000000000; 18.7932988441; -3.2870000000; 9.7280000000; 0.8999399568; 6.4077416273; -3.1451829134; 1.0000000100; 0.0000000000; 0.9480589053; 0.0000000000;
    3.0625000000; 1.0000000000; 18.7932988441; -3.2870000000; 9.7280000000; 0.8998799074; 6.2394046705; -2.9768465052; 1.0000000200; 0.0000000000; 0.8988158138; 0.0000000000;
     
    4.0625000000; 1.0000000000; 19.0445703499; -3.2870000000; 9.7320000000; 0.8998799074; 6.2394046705; -2.9768465052; 1.0000000200; 0.0000000000; 0.8988158138; 0.0000000000;
    4.0625000000; 1.0000000000; 19.0445703499; -3.2870000000; 9.7320000000; 0.8998198333; 6.0754981785; -2.8129479844; 1.0000000300; 0.0000000000; 0.8521305805; 0.0000000000;

    5.0625000000; 1.0000000000; 18.9300200447; -3.2870000000; 9.7320000000; 0.8998198333; 6.0754981785; -2.8129479844; 1.0000000300; 0.0000000000; 0.8521305805; 0.0000000000;
    5.0625000000; 1.0000000000; 18.9300200447; -3.2870000000; 9.7320000000; 0.8997597592; 5.9159054233; -2.6533532901; 1.0000000400; 0.0000000000; 0.8078703403; 0.0000000000;

    So it's good enough that the VI and it works fine until some point when the just VI reads more calculation and x = sheet! There? becomes true.

    Most of the time it happens when the csv file is about 1200 lines

    Someone knows why this happens?

    Best regards

    Stefan

    Hello

    understood, that the error occurs somewhere completely else. the thread may be closed

    BR

    Stefan

  • Having problems all the time trying to use MSN, just get a series of announcements

    These ads I seem unable to get rid of, usually are advertising job, or offer free cameras etc. I usually finish which for Skype where I don't have the same problem

    Try MSN Help.

  • Problems with crash blue screen: seems to be a problem with the updates? Maybe w Java or updates from HP? Vista Ultimate on Hp Pavilion;

    Here are my logs of the events which, in my view, are relevant elements n pieces:

    Computer is old 4 shape: tried MS point-to-point previous system restore
    but nothing helps: tried Antispyware and malware and ran Avast: found Logger virus that had been deleted

    Can turn on the computer but crashes whenever I try to do anything:

    Event 1000
    Application error
    (task category 100)

    Failed application jucheck.exe, version 2.0.2.4, time stamp 0x4bed9a0d, failed module unknown, version 0.0.0.0, time stamp 0x00000000, exception code 0xc0000005, offset 0x7589a57d, process id 0 x 280 error, start the application time 0x01cc6d8f5d03816c.
    ----
    Event 1002

    Category: Dhcp Client

    The lease of the IP address 192.168.1.100 for the network card with network address 001B77C0E361 has been denied by server 0.0.0.0 (the DHCP server sent a DHCPNACK message).
    -----
    Event 2017

    SRV

    The server failed to allocate from the system non-paged pool because the server reached the limit configured for the non paged pool allocations.
    ===

    Event 2004
    Windows Defender

    Windows Defender encountered an error trying to load signatures and will try to return to a verified set of signatures.
    Signatures sought: current
    Error code: 0x8050a001
    Error description: the program cannot find the definition files that detect unwanted software. Check for updates to the definition files and then try again. For more information about installing updates, see Help and Support.
    Loading of signatures: backup
    Signature of loading version: 1.111.1301.0
    Loading engine version: 1.1.7604.0
    -----
    Event ID: 4609

    Category: EventSystem

    Internal system of events from COM + has detected what a bad code back during his treatment.  HRESULT has c 8007043 line 45 of d:\longhorn\com\complus\src\events\tier1\eventsystemobj.cpp.  Contact the Services de Support technique Microsoft to report this error.
    ----
    Event: 10005
    DistributedCOM

    DCOM got error "1068" trying to start the BITS service with arguments "" to start the server:
    {4991D34B-80A1-4291-83B6-3328366B9097}
    Event 4609
    ----
    Category: EventSystem

    Intel (r) PRO/Wireless 3945ABG Network Connection: has determined that the network adapter does not work correctly.

    ----
    Event 7001

    Service control manager event

    The computer browser service depends on the Server service which failed to start because of the following error:
    The dependency service or group was able to start.
    -----

    Event 8193
    System restore

    Unable to create on the volume restore point (process = C:\Program Files (x 86) \Common Files\Microsoft Shared\OFFICE14\Office Setup Controller\Setup.exe files (x 86) \Common Files\Microsoft Shared\OFFICE14\Office Setup Controller\Setup.exe"- Embedding;) Descripton configured = Microsoft Office Home and Student 2010. (HR = 0x8007043c).
    ----

    SuperFetch, computer Microsoft which preloads software in memory in order to reduce their loading time - see Windows Vista IO technologies

    Much disabled the feature-

    http://www.howtogeek.com/HOWTO/Windows-Vista/how-to-disable-SuperFetch-on-Windows-Vista/

    To correct the "not".

    Navigate to the C:\Windows\Prefetch folder

    Click on the first item in the list to select

    Press Ctrl + A to select all

    Press Delete

    Close this window

    8000287B1A3A that does not appear in the error messages-

    With avast, it would be driver question - problem with their known software

    You could try

    Microsoft Security Essentials - freeware

    http://www.Microsoft.com/en-us/security_essentials/default.aspx

    ClamWin freeware

    http://download.CNET.com/ClamWin-antivirus/3000-2239_4-10369483.html

    Malwarebytes freeware

    http://www.Malwarebytes.org/products

  • Problem with the post OFFICE when using HttpsConnection

    Hello community,

    my scenario:

    I have a piece of code that runs on a BB and a Servlet located on a Tomcat 6.0.18. The code on the BB uses POST to send data. When you use with HTTP POST, everything works like a charm, but I have trouble with the POST and HTTPS.

    It seems that the data is not transferred from BB on the server. The use of the debugger I discovered that the data is written to the output stream (side), but when the servlet calls getParameter() only null is returned.

    To ensure a correct installation, I tried a GET with HTTPS which works very well.

    The given code example is on the side of the unit

    connection = Connector.open(url);
    
    HttpsConnection https = (HttpsConnection)connection;
    
    https.setRequestMethod(HttpsConnection.POST);
    
    https.setRequestProperty(HEADER_CONTENTTYPE, CONTENTTYPE_FORMDATA);
    
    https.setRequestProperty(HEADER_CONTENTTYPE, String.valueOf(length));
    
    out = https.openOutputStream();out.write(PostMessage.getBytes());
    
    in = https.openInputStream();
    
    ResponseMessage = new byte[(int)https.getLength()];
    
    in.read(ResponseMessage);
    
    out.close();in.close();https.close();
    

    Any help is very appreciated!

    Thanks in advance.

    PS:

    Simulator: 8300

    MDS: 4.1.4

    JDE: 4.5.0

    Eclipse: Version: 3.4.1
    Build id: M20080911-1700

    Dear community,

    I managed to solve the problem by myself. Its a classic copy & paste error.

    Lets take a look at:

    https.setRequestProperty(HEADER_CONTENTTYPE, CONTENTTYPE_FORMDATA);
    
    https.setRequestProperty(HEADER_CONTENTTYPE, String.valueOf(length));
    

    As you can see I used two times HEADER_CONTENTTYPE. Its not so bad, but to indicate the length of a post, you need to use HEADER_CONTENTLENGTH:-D.

    I have to take a break...

    You can consider the issue as resolved.

Maybe you are looking for