Export view to xml using lotusscript

Hi all,

can you please give suggestions to work with xml? I need to create the xml file like this from a category view.

<name> Delaer </name>
<subcatname> Helath </subcatname>

   <subsubcategory>

     <subsubcatname>heart</subsubcatname>

    </subsubcategory>

I have a categorized view like category,subcategory,subsubcategory.

I have tried using notesdxlexporter but it is exporting according its own way.

Thanks in advance,

with hope

Subject: Export view to xml using lotusscript

Hello friend,

try this once if it suits to your requirement…

http://servername/databasename/viewname?Readviewentries

It will give XML as hierarchy manner…catageory (position as 1), subcatageory (as 1.1), subsubcatageory (as 1.1.1)…and so on.

Thanks,

Sreedhar.

Subject: RE: Export view to xml using lotusscript

Hi thanks for ur assistence, but i unable to open the given link it is giving 404 not found error. I need example code to implement if possible help in this.

thanks in advance

Subject: Show us your URL

Maybe you have it wrong.

Does the ACL on the database allow web users to see the database.

Sadly God maybe Love, but he doesn’t help us see what you don’t tell us.

Subject: Export view to xml using lotusscript

You will need to “walk” the view with a NotesViewNavigator using GetFirst and GetNext. The NotesViewEntry returned will have an IsCategory property and a ColumnIndentLevel to tell you whether its a main category, subcategory, etc. You’ll need to keep track of the category level yourself and write the XML to a file (using a NotesStream would probably be easiest).

Subject: RE: Export view to xml using lotusscript

Thank you for your assistence, I have tried like this but i am getting duplicate values, for more clarification can you please give example code?

Set viewnav = view.CreateViewNav()

Set entry=viewnav.GetFirst



While Not(entry Is Nothing)

	If Not entry.IndentLevel = 0 Then

		If entry.ColumnValues(0) <> "" Then

			Call stream.WriteText("<Category>")

			Call stream.WriteText("<Name>"& entry.ColumnValues(0)&"</Name>")

		End If

		subcat2count =entry.SiblingCount

		Call stream.WriteText("<SubCategory>")

		Call stream.WriteText("<SubcatName>"& entry.ColumnValues(1)&"</SubcatName>")

		Call stream.WriteText("</SubCategory>")

		Call stream.WriteText("</Category>")

	End If

	Set entry = viewnav.GetNext(entry)		

	'level = entry.IndentLevel

Wend

stream.Close

thanks a lot