<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=big5">


<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 10">
<meta name=Originator content="Microsoft Word 10">
<link rel=File-List href="cid:filelist.xml@01C1E48F.3C8797E0">
<!--[if gte mso 9]><xml>
 <o:OfficeDocumentSettings>
  <o:DoNotRelyOnCSS/>
 </o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:GrammarState>Clean</w:GrammarState>
  <w:DocumentKind>DocumentEmail</w:DocumentKind>
  <w:EnvelopeVis/>
  <w:PunctuationKerning/>
  <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery>
  <w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery>
  <w:Compatibility>
   <w:SpaceForUL/>
   <w:BalanceSingleByteDoubleByteWidth/>
   <w:DoNotLeaveBackslashAlone/>
   <w:ULTrailSpace/>
   <w:DoNotExpandShiftReturn/>
   <w:AdjustLineHeightInTable/>
   <w:UseFELayout/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;
        mso-font-alt:Webdings;
        mso-font-charset:2;
        mso-generic-font-family:auto;
        mso-font-format:other;
        mso-font-pitch:variable;
        mso-font-signature:0 268435456 0 0 -2147483648 0;}
@font-face
        {font-family:新細明體;
        panose-1:2 2 3 0 0 0 0 0 0 0;
        mso-font-alt:PMingLiU;
        mso-font-charset:136;
        mso-generic-font-family:roman;
        mso-font-pitch:variable;
        mso-font-signature:3 137232384 22 0 1048577 0;}
@font-face
        {font-family:Marlett;
        panose-1:0 0 0 0 0 0 0 0 0 0;
        mso-font-charset:2;
        mso-generic-font-family:auto;
        mso-font-pitch:variable;
        mso-font-signature:0 268435456 0 0 -2147483648 0;}
@font-face
        {font-family:"\@新細明體";
        panose-1:2 2 3 0 0 0 0 0 0 0;
        mso-font-charset:136;
        mso-generic-font-family:roman;
        mso-font-pitch:variable;
        mso-font-signature:3 137232384 22 0 1048577 0;}
@font-face
        {font-family:"Book Antiqua";
        panose-1:2 4 6 2 5 3 5 3 3 4;
        mso-font-charset:0;
        mso-generic-font-family:roman;
        mso-font-pitch:variable;
        mso-font-signature:647 0 0 0 159 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {mso-style-parent:"";
        margin:0cm;
        margin-bottom:.0001pt;
        mso-pagination:none;
        font-size:12.0pt;
        font-family:"Book Antiqua";
        mso-fareast-font-family:新細明體;
        mso-bidi-font-family:"Book Antiqua";
        mso-font-kerning:1.0pt;}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;
        text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;
        text-underline:single;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        mso-style-noshow:yes;
        mso-ansi-font-size:9.0pt;
        mso-bidi-font-size:10.0pt;
        font-family:Arial;
        mso-ascii-font-family:Arial;
        mso-fareast-font-family:新細明體;
        mso-hansi-font-family:Arial;
        mso-bidi-font-family:Arial;
        color:windowtext;}
span.GramE
        {mso-style-name:"";
        mso-gram-e:yes;}
 /* Page Definitions */
 @page
        {mso-page-border-surround-header:no;
        mso-page-border-surround-footer:no;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;
        mso-header-margin:42.55pt;
        mso-footer-margin:49.6pt;
        mso-paper-source:0;
        layout-grid:18.0pt;}
div.Section1
        {page:Section1;}
 /* List Definitions */
 @list l0
        {mso-list-id:556864471;
        mso-list-type:hybrid;
        mso-list-template-ids:-90693508 -1993155160 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:42.0pt;
        mso-level-number-position:left;
        margin-left:42.0pt;
        text-indent:-18.0pt;
        font-family:Wingdings;
        mso-fareast-font-family:新細明體;
        mso-bidi-font-family:Arial;}
@list l1
        {mso-list-id:1330602176;
        mso-list-type:hybrid;
        mso-list-template-ids:1325319264 25303896 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l1:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:42.0pt;
        mso-level-number-position:left;
        margin-left:42.0pt;
        text-indent:-18.0pt;
        font-family:Wingdings;
        mso-fareast-font-family:新細明體;
        mso-bidi-font-family:Arial;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
-->
</style>
<!--[if gte mso 10]>
<style>
 /* Style Definitions */ 
 table.MsoNormalTable
        {mso-style-name:表格內文;
        mso-tstyle-rowband-size:0;
        mso-tstyle-colband-size:0;
        mso-style-noshow:yes;
        mso-style-parent:"";
        mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
        mso-para-margin:0cm;
        mso-para-margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Book Antiqua";}
</style>
<![endif]-->
</head>

<body lang=ZH-TW link=blue vlink=purple style='tab-interval:24.0pt;text-justify-trim:
punctuation'>

<div class=Section1 style='layout-grid:18.0pt'>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial;mso-bidi-font-family:Arial'>Dear
all:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial;mso-bidi-font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial;mso-bidi-font-family:Arial'><span
style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
class=GramE>&lt;?pi</span> href = <span style='mso-spacerun:yes'>&nbsp;</span>”http://www.jdom.org”
<span style='mso-spacerun:yes'>&nbsp;</span>media = “wap”?&gt; &lt;!-- Please
note the spaces inserted between the equal, ‘=’, signs.--&gt;<o:p></o:p></span></font></p>

<p class=MsoNormal><span class=GramE><font size=1 face=Arial><span lang=EN-US
style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial;mso-bidi-font-family:
Arial'>won’t</span></font></span><font size=1 face=Arial><span lang=EN-US
style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial;mso-bidi-font-family:
Arial'> be parsed properly if you set data via the following code snippet.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial;mso-bidi-font-family:Arial'>ProcessingInstruction
<span class=GramE>pi(</span>“pi”, “href = <span
style='mso-spacerun:yes'>&nbsp;</span><span
style='mso-spacerun:yes'>&nbsp;</span>\”http://www.jdom.org\” <span
style='mso-spacerun:yes'>&nbsp;</span>media = <span
style='mso-spacerun:yes'>&nbsp;</span>\“wap\””); <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial;mso-bidi-font-family:Arial'>//
<span class=GramE>Please</span> note the spaces inserted between the equal, ‘=’,
signs.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial;mso-bidi-font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial;mso-bidi-font-family:Arial'><span
style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>After
hacking into the source, org.jdom.ProcessingInstuction.java, it failed on the
privte function:<o:p></o:p></span></font></p>

<p class=MsoNormal><span class=GramE><font size=1 face=Arial><span lang=EN-US
style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial;mso-bidi-font-family:
Arial'>private</span></font></span><font size=1 face=Arial><span lang=EN-US
style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial;mso-bidi-font-family:
Arial'> Map paresData(String rawData), while parsing the media attribute.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial;mso-bidi-font-family:Arial'><span
style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>The
suspicious code is “pos += <span class=GramE>value.lenth(</span>) + 1;” in code
sinppet below:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial;mso-bidi-font-family:Arial'><span
style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>….<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-indent:24.0pt'><font size=1 face=Arial><span
lang=EN-US style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial;
mso-bidi-font-family:Arial'><span style='mso-spacerun:yes'>&nbsp; </span><span
class=GramE>if</span> (currentChar == '=') {<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial;mso-bidi-font-family:Arial'><span
style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span class=GramE>name</span> = inputData.substring(startName,
pos).trim();<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial;mso-bidi-font-family:Arial'><span
style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span class=GramE>value</span> = extractQuotedString(inputData.substring(pos+1).trim());<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial;mso-bidi-font-family:Arial'><span
style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>//
A null value means a parse error and we return empty!<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial;mso-bidi-font-family:Arial'><span
style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span class=GramE>if</span> (value == null) {<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial;mso-bidi-font-family:Arial'><span
style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span class=GramE>return</span> new HashMap();<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial;mso-bidi-font-family:Arial'><span
style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>}<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial;mso-bidi-font-family:Arial'><span
style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><font color=red><span style='color:red'><span
style='mso-spacerun:yes'>&nbsp;</span><span class=GramE>pos</span> +=
value.length() + 1;<span style='mso-spacerun:yes'>&nbsp; </span>// skip over
equals and value<o:p></o:p></span></font></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial;mso-bidi-font-family:Arial'><span
style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span class=GramE>break</span>;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial;mso-bidi-font-family:Arial'><span
style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>}<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial;mso-bidi-font-family:Arial'><span
style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>……<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:42.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo2;
tab-stops:list 42.0pt'><![if !supportLists]><font size=1 face=Wingdings><span
lang=EN-US style='font-size:9.0pt;mso-bidi-font-size:10.0pt;font-family:Wingdings;
mso-fareast-font-family:Wingdings;mso-bidi-font-family:Wingdings'><span
style='mso-list:Ignore'>&eth;<font size=1 face="Times New Roman"><span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp; </span></font></span></span></font><![endif]><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;mso-bidi-font-size:
10.0pt;font-family:Arial;mso-bidi-font-family:Arial'>Since there are extra
spaces between ‘=’ sign for the first “href” attribute, we shouldn’t just naiively
use pos += <span class=GramE>value.length(</span>) + 1 to skip over value. This
will not move to the media attribute, but rather between the <span class=GramE>value</span>
of href.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial;mso-bidi-font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial;mso-bidi-font-family:Arial'>Regards,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial;mso-bidi-font-family:Arial'>Albert<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial;mso-bidi-font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial;mso-bidi-font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial;mso-bidi-font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;mso-bidi-font-size:10.0pt;font-family:Arial;mso-bidi-font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

</div>

</body>

</html>