View Issue Details

IDProjectCategoryView StatusLast Update
0001857JEDI VCL00 JVCL Componentspublic2004-06-21 06:17
ReportercpallAssigned Touser72 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0001857: TjvSimpleXML isn't quite reading my xml properly
Description<SMART_DOCUMENT xmlns="http://www.mismo.org" xmlns:emrtg="http://www.mismo.org" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:MISMOVersionIdentifier="1.02" xmlns:PopulatingSystemDocumentIdentifier="ident">

becomes

<SMART_DOCUMENT xmlns="http://www.mismo.org" xmlns:emrtg="http://www.mismo.org" xmlns:xlink="http://www.w3.org/1999/xlink" MISMOVersionIdentifier="1.02" PopulatingSystemDocumentIdentifier="DPS_3260e">

...
I haven't gotten to why yet, but it is lopping off some of the data.

I will look at it but I can't make any promises as to why this is happening.
TagsNo tags attached.

Activities

cpall

2004-06-13 14:46

reporter   ~0004547

two things, it didn't change the identifier, that was me, sorry, the part that it is "losing" is the xmlns: before the two last attributes.

Thanks

user72

2004-06-14 01:06

  ~0004550

I created a small app with two memos, a TJvSimpleXML and a button. OnClick for button:

procedure TForm1.Button1Click(Sender: TObject);
begin
  JvSimpleXML1.LoadFromString(Memo1.Lines.Text);
  Memo2.Lines.Text := JvSimpleXML1.SaveToString;
end;

Feeding in your xml verbatim (sxoAutoEncodeValue and sxoAutoEncodeEntry set to false), gave me back:

<?xml version="1.0" encoding="iso-8859-1"?>
<SMART_DOCUMENT xmlns="<http://www.mismo.org>" xmlns:emrtg="<http://www.mismo.org>" xmlns:xlink="<http://www.w3.org/1999/xlink>" xmlns:MISMOVersionIdentifier="1.02" xmlns:PopulatingSystemDocumentIdentifier="ident"/>

Looks OK to me...

This was with v 1.36 (2004-06-11)

2004-06-14 12:07

 

jvclXMLTroubles.zip (4,039 bytes)

anonymous

2004-06-14 12:08

viewer   ~0004554

Silly me. It is actually adding data, not losing data... looks more like this:

<SMART_DOCUMENT xmlns="http://www.mismo.org" xmlns:emrtg="http://www.mismo.org" xmlns:xlink="http://www.w3.org/1999/xlink" MISMOVersionIdentifier="1.02" PopulatingSystemDocumentIdentifier="DPS_3260e">

which gets turned into:
<SMART_DOCUMENT xmlns="http://www.mismo.org" xmlns:emrtg="http://www.mismo.org" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:MISMOVersionIdentifier="1.02" xmlns:PopulatingSystemDocumentIdentifier="DPS_3260e">

I have included a working demonstration of the problem to make up for my lack of one before, thanks.

Chris

cpall

2004-06-14 12:09

reporter   ~0004555

err... that was me :)

cpall

2004-06-18 20:02

reporter   ~0004588

Whoo hoo! I got the fix.

Line 1893 in source taken June 18th, when we begin to read the Name for the property, we need to clear the pointer variable out as well.

      case lPos of
        ptWaiting: //We are waiting for a property
          begin
            case lBuf[I] of
              ' ', Tab, Cr, Lf:
                begin
                end;
              'a'..'z', 'A'..'Z', '0'..'9', '-', '_':
                begin
                  lName := lBuf[I];
                  lPos := ptReadingName;
                end;
              '/', '>', '?':
                begin
                  Dec(lStreamPos);
                  Count := 0;
                  Break;
                end;
            else
              FmtError(RsEInvalidXMLElementUnexpectedCharacte, [lBuf[I]]);
            end;
          end;

.
.
.
becomes
.
.
.
      case lPos of
        ptWaiting: //We are waiting for a property
          begin
            case lBuf[I] of
              ' ', Tab, Cr, Lf:
                begin
                end;
              'a'..'z', 'A'..'Z', '0'..'9', '-', '_':
                begin
                  lName := lBuf[I];
                  lPointer := ''; // cgp, clear the pointer variable here or at some point
                  lPos := ptReadingName;
                end;
              '/', '>', '?':
                begin
                  Dec(lStreamPos);
                  Count := 0;
                  Break;
                end;
            else
              FmtError(RsEInvalidXMLElementUnexpectedCharacte, [lBuf[I]]);
            end;
          end;

user72

2004-06-21 06:17

  ~0004591

Fixed in CVS

Issue History

Date Modified Username Field Change
2004-06-13 14:45 cpall New Issue
2004-06-13 14:46 cpall Note Added: 0004547
2004-06-14 01:06 user72 Note Added: 0004550
2004-06-14 01:06 user72 Status new => feedback
2004-06-14 12:07 anonymous File Added: jvclXMLTroubles.zip
2004-06-14 12:08 anonymous Note Added: 0004554
2004-06-14 12:09 cpall Note Added: 0004555
2004-06-18 20:02 cpall Note Added: 0004588
2004-06-21 06:17 user72 Status feedback => resolved
2004-06-21 06:17 user72 Resolution open => fixed
2004-06-21 06:17 user72 Assigned To => user72
2004-06-21 06:17 user72 Note Added: 0004591