diff -r 000000000000 -r 62f9d29f7211 webservices/wsstar/wsstarmessagehandlers/src/wsstarmessageutils.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/webservices/wsstar/wsstarmessagehandlers/src/wsstarmessageutils.cpp Thu Jan 07 16:19:19 2010 +0200 @@ -0,0 +1,159 @@ +/* +* Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + + + + + + + + +#include "wsstarmessageutils.h" +#include + +CSenElement* CWSStarMessageUtils::GetMarkedElementL(CSenElement& aParent, + const TDesC8& aValue, TBool aAttribute) + { + CSenElement* markedEl = NULL; + +//1.flat choose + RPointerArray& elements = aParent.ElementsL(); + TInt count(elements.Count()); + TInt i=0; + while (iAttrValue(aValue)) + { + markedEl = NULL; + } + } + else + { + if (markedEl->LocalName() != aValue) + { + markedEl = NULL; + } + } + + i++; + } + +//2.go deeper + if (!markedEl) + { + elements = aParent.ElementsL(); + TInt count(elements.Count()); + TInt i=0; + while (i nodeList; + TXmlEngElement parent; + aParent.GetElementsByTagNameL( nodeList, aElementName , aNamespace ); + if( nodeList.Count() ) + { + parent = nodeList.Next(); + aElements->AppendL(parent); + } + + RXmlEngNodeList nodeChildList; + aParent.GetChildElements(nodeChildList); + + TInt count( nodeChildList.Count() ); + for(TInt i(0) ; i& elements = aParent.ElementsL(); + TInt count(elements.Count()); + TInt i=0; + while (iLocalName() != aLocalName) + { + elem = NULL; + } + i++; + } + + if (!elem) + { + elements = aParent.ElementsL(); + TInt count(elements.Count()); + TInt i=0; + while (i& elements = aParent.ElementsL(); + TInt count(elements.Count()); + TInt i=0; + while (iLocalName() == aLocalName) + { + aElements.Append(elem); + } + CWSStarMessageUtils::FindElementL(aLocalName, *elem,aElements); + elem = NULL; + i++; + } + }