![]() |
CXTPPropExchangeXMLNode & CompactMode |
Post Reply ![]() |
Author | ||
jimmy ![]() Senior Member ![]() Joined: 11 November 2003 Location: Austria Status: Offline Points: 516 |
![]() ![]() ![]() ![]() ![]() Posted: 28 August 2008 at 10:22am |
|
Hello,
What is CompactMode ? Why do i need this ? i will only read a small xml file (LoadFromFile) and retrive Name with PX_String( &px, "Name", strName, ""); But i don't get Name. After i set CompactMode="1" , it work. Why is this so ? <?xml version="1.0" encoding="UTF-8"?> <FB Name="AND" Comment="Some Comment" Revision="1.0" FolderPos="1" > <Outputs> <Out Name="OUT" DataType="bool" Initialized="true"/> </Outputs> </FB> Jimmy |
||
![]() |
||
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
|
CompactMode switch way to store data:
with compact mode:
<FB Name="AND" />
without:
<FB> <Name>AND</Name> </FB>
|
||
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
||
![]() |
||
jimmy ![]() Senior Member ![]() Joined: 11 November 2003 Location: Austria Status: Offline Points: 516 |
![]() ![]() ![]() ![]() ![]() |
|
Hi,
Mean that i can't use this ? <FB Name="AND"> <Input Name="Input1>Some Text</Input> <Input Name="Input1>Some other Text</Input> </FB> Here i have attribute (Name) and other text. Jimmy |
||
![]() |
||
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
|
With Compact mode can: PX_String( &px, "", strName, "");
|
||
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
||
![]() |
||
jimmy ![]() Senior Member ![]() Joined: 11 November 2003 Location: Austria Status: Offline Points: 516 |
![]() ![]() ![]() ![]() ![]() |
|
Thanks
Jimmy |
||
![]() |
||
cpede ![]() Senior Member ![]() Joined: 13 August 2004 Location: Denmark Status: Offline Points: 680 |
![]() ![]() ![]() ![]() ![]() |
|
Sorry, but can you be a bit more precise?
How can I read the compact name tag?
And what if I have multiple compact tags? And mixing?
cpede
|
||
![]() |
||
jimmy ![]() Senior Member ![]() Joined: 11 November 2003 Location: Austria Status: Offline Points: 516 |
![]() ![]() ![]() ![]() ![]() |
|
Is there a simple way to enable ompact mode without CompactMode attribute ?
Jimmy Now i do this class CXTPPropExchangeXMLNodeEx : public CXTPPropExchangeXMLNode { public: CXTPPropExchangeXMLNodeEx(BOOL bLoading, CXTPDOMNodePtr xmlParentNode, LPCTSTR lpszSection) : CXTPPropExchangeXMLNode(bLoading, xmlParentNode, lpszSection) { } bool DeleteAttr(LPCTSTR lpszEntry) { USES_CONVERSION; CXTPDOMNodePtr xmlNodeEntryPtr; XTPXML::IXMLDOMNamedNodeMapPtr map; m_xmlSectionNode->get_attributes(&map); HRESULT hr = map->removeNamedItem(CT2BSTR(lpszEntry), &xmlNodeEntryPtr); if (FAILED(hr)) return false; return true; } virtual BOOL OnBeforeExchange() { BOOL bOk = __super::OnBeforeExchange(); SetCompactMode(TRUE); return bOk; } }; |
||
![]() |
||
cpede ![]() Senior Member ![]() Joined: 13 August 2004 Location: Denmark Status: Offline Points: 680 |
![]() ![]() ![]() ![]() ![]() |
|
Please, how do I mix Compact modes in one XML file?
-cpede
|
||
![]() |
||
jimmy ![]() Senior Member ![]() Joined: 11 November 2003 Location: Austria Status: Offline Points: 516 |
![]() ![]() ![]() ![]() ![]() |
|
Hi,
i think, if compacteMode is enabled, you can access with PX_String( &px, "AttrName", strName, "");a attribute entry and with PX_String( &px, "", strName, ""); you can access the normal text <Input AttrName="AttributeValue">Normal Text</Input> Jimmy |
||
![]() |
||
cpede ![]() Senior Member ![]() Joined: 13 August 2004 Location: Denmark Status: Offline Points: 680 |
![]() ![]() ![]() ![]() ![]() |
|
But what if Compact mode is NOT enabled, how do I access the attributes?
I guess that this is the most normal case for external XML files, since the Compact attribute/tag is something invented by CodeJock?
-cpede
|
||
![]() |
||
cpede ![]() Senior Member ![]() Joined: 13 August 2004 Location: Denmark Status: Offline Points: 680 |
![]() ![]() ![]() ![]() ![]() |
|
Is this implemented in v17.3?
Can I access compact attributes and nodes in CXTPPropExchangeXMLNode? Maybe something like this:
-cpede |
||
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64) Language: Visual Studio 2017 (C++) |
||
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |