注册 登录
编程论坛 ASP技术论坛

关于.xml的问题

kevinxu0638 发布于 2010-11-23 14:30, 616 次点击
程序代码:
<gallery>
    <setup>
        <imgPath>images/</imgPath>

        <slideshowOn>false</slideshowOn>

        <thumbScrollSpeed>15</thumbScrollSpeed>
        <loadIndicatorOn>true</loadIndicatorOn>
        <loadIndicatorColor>0xFFFFFF</loadIndicatorColor>
        <slideshowDelay>4</slideshowDelay>
        <stopAutoOnClick>true</stopAutoOnClick>
        <randomImages>false</randomImages>
        <slideshowLoop>true</slideshowLoop>
        <bgCorner>10</bgCorner>
        <bgAlpha>1</bgAlpha>
        <bgColor>0xFFFFFF</bgColor>

        <imgScaleMode>scaleToAreaWidth</imgScaleMode>
        <imgScaleAlignVert>top</imgScaleAlignVert>
        <imgScaleAlignHor>center</imgScaleAlignHor>
        <imgMaskCorner>10</imgMaskCorner>
        <imgAlpha>1</imgAlpha>
        <imgShadowOn>true</imgShadowOn>
        <imgShadowDistance>4</imgShadowDistance>
        <imgShadowSize>4</imgShadowSize>
        <imgShadowAngle>90</imgShadowAngle>

        <imgCaptionFont>Verdana</imgCaptionFont>
        <imgCaptionColor>0xFFFFFF</imgCaptionColor>
        <imgCaptionSize>10</imgCaptionSize>
        <imgCaptionAlpha>0.7</imgCaptionAlpha>
        <imgCaptionPosition>bottom</imgCaptionPosition>
        <imgCaptionBgColor>0x000000</imgCaptionBgColor>
        <imgCaptionBgAlpha>0.7</imgCaptionBgAlpha>
        <imgCaptionShadowOn>true</imgCaptionShadowOn>
                <imgCaptionShow>onRollOver</imgCaptionShow>

        <transitionEffect>zoom</transitionEffect>
        <transitionStartPoint>right</transitionStartPoint>
        <transitionDirection>horizontal/ccw</transitionDirection>
        <transitionRotateDegrees>820</transitionRotateDegrees>
        <transitionIrisShape>square</transitionIrisShape>
        <transitionPixelDissolveSize>10</transitionPixelDissolveSize>
        <transitionEasingType>strong</transitionEasingType>
        <transitionEasingFunction>out</transitionEasingFunction>
        <transitionTime>1</transitionTime>

        <thumbWidth>40</thumbWidth>
        <thumbHeight>30</thumbHeight>
        <thumbMaskCorner>5</thumbMaskCorner>

        <spaceBetweenThumbs>10</spaceBetweenThumbs>
        <thumbRowsCount>1</thumbRowsCount>
        <thumbPosition>bottom</thumbPosition>
        <thumbToImgSpace>15</thumbToImgSpace>
        <thumbAlpha>0.5</thumbAlpha>
        <thumbReflectionsOn>true</thumbReflectionsOn>
        <thumbReflectionsAlpha>0.5</thumbReflectionsAlpha>
        <thumbReflectionsHeight>40</thumbReflectionsHeight>
        <thumbPreviewOn>true</thumbPreviewOn>
        <thumbPreviewMaskCorner>5</thumbPreviewMaskCorner>
        <thumbPreviewWidth>160</thumbPreviewWidth>
        <thumbPreviewHeight>120</thumbPreviewHeight>
        <thumbPreviewDistance>8</thumbPreviewDistance>
        <thumbPreviewAlpha>0.9</thumbPreviewAlpha>
        <thumbPreviewDelay>0.5</thumbPreviewDelay>
        <thumbPreviewShowAnimationTime>1</thumbPreviewShowAnimationTime>
        <thumbSoundOnRollover>sounds/over.mp3</thumbSoundOnRollover>
        <thumbSoundOnClick>sounds/click.mp3</thumbSoundOnClick>
        <thumbOutlineThick>1</thumbOutlineThick>
        <thumbOutlineAlpha>1</thumbOutlineAlpha>
        <thumbOutlineColor>0x000000</thumbOutlineColor>
        <thumbOutlineColorRoll>0xFFFFFF</thumbOutlineColorRoll>
        <thumbOutlineColorActive>0x8B0000</thumbOutlineColorActive>
        <thumbShadowOn>true</thumbShadowOn>
        <thumbShadowDistance>4</thumbShadowDistance>
        <thumbShadowSize>4</thumbShadowSize>
        <thumbShadowAngle>90</thumbShadowAngle>   

        <showButtonsOn>true</showButtonsOn>
        <buttonsAlignVert>top</buttonsAlignVert>
        <buttonsAlignHor>right</buttonsAlignHor>

                <backgroundImgPath>images/bg.jpg</backgroundImgPath>
        <backgroundImgAlpha>1</backgroundImgAlpha>

    </setup>

    <item>
        <thumb>1.jpg</thumb>
        <img>1.jpg</img>
        <caption>Art Flash Gallery is based on Adobe Flash (cs3) technology. It will help you easily post any images on your site in a matter of minutes.</caption>
    </item>

    <item>
        <thumb>2.jpg</thumb>
        <img>2.jpg</img>
        <caption>Art Flash Gallery is based on Adobe Flash (cs3) technology. It will help you easily post any images on your site in a matter of minutes.</caption>
    </item>

    <item>
        <thumb>3.jpg</thumb>
        <img>3.jpg</img>
        <caption>Art Flash Gallery is based on Adobe Flash (cs3) technology. It will help you easily post any images on your site in a matter of minutes.</caption>
    </item>

    <item>
        <thumb>4.jpg</thumb>
        <img>4.jpg</img>
        <caption>Art Flash Gallery is based on Adobe Flash (cs3) technology. It will help you easily post any images on your site in a matter of minutes.</caption>
    </item>

    <item>
        <thumb>5.jpg</thumb>
        <img>5.jpg</img>
        <caption>Art Flash Gallery is based on Adobe Flash (cs3) technology. It will help you easily post any images on your site in a matter of minutes.</caption>
    </item>

    <item>
        <thumb>6.jpg</thumb>
        <img>6.jpg</img>
        <caption>Art Flash Gallery is based on Adobe Flash (cs3) technology. It will help you easily post any images on your site in a matter of minutes.</caption>
    </item>

    <item>
        <thumb>7.jpg</thumb>
        <img>7.jpg</img>
        <caption>Art Flash Gallery is based on Adobe Flash (cs3) technology. It will help you easily post any images on your site in a matter of minutes.</caption>
    </item>

    <item>
        <thumb>8.jpg</thumb>
        <img>8.jpg</img>
        <caption>Art Flash Gallery is based on Adobe Flash (cs3) technology. It will help you easily post any images on your site in a matter of minutes.</caption>
    </item>

    <item>
        <thumb>9.jpg</thumb>
        <img>9.jpg</img>
        <caption>Art Flash Gallery is based on Adobe Flash (cs3) technology. It will help you easily post any images on your site in a matter of minutes.</caption>
    </item>

    <item>
        <thumb>10.jpg</thumb>
        <img>10.jpg</img>
        <caption>Art Flash Gallery is based on Adobe Flash (cs3) technology. It will help you easily post any images on your site in a matter of minutes.</caption>
    </item>

    <item>
        <thumb>11.jpg</thumb>
        <img>11.jpg</img>
        <caption>Art Flash Gallery is based on Adobe Flash (cs3) technology. It will help you easily post any images on your site in a matter of minutes.</caption>
    </item>



</gallery>


这个是一个.xml文件 我不知道在论坛哪个版块可以发 就在ASP了如果发错地方了 还望版主见谅 告诉小弟到哪儿发
好下面是问题 我想将红色部分的内容来自数据库 我把红的部分给成
<%
     Dim db,rs,strSql
    Set db=Server.CreateObject("ADODB.Connection")
    db.Open "Dsn=background"                           
    Set rs=Server.CreateObject("ADODB.Recordset")
    strsql="select * from lh "
    rs.Open strSql,db,1
    %>
<%
i = 0
Do While rs.EOF = False
%>

    <item>


        <thumb><%=rs("imgsrc1")%></thumb>
        <img><%=rs("imgsrc1")%></img>
        <caption><%=rs("sj_name")%></caption>

    </item>

    <%
    i = i + 1
    rs.MoveNext
Loop
   %>
这样不行出错了 有谁懂XML教教小弟 小弟没学过 现在做个东西用到了这个文件 帮帮忙~~小弟急

[ 本帖最后由 kevinxu0638 于 2010-11-23 14:33 编辑 ]
5 回复
#2
yms1232010-11-23 21:11
XML不同于HTML,XML要更严格,因此对于空格或特殊字符很敏感。
#3
gupiao1752010-11-23 22:44
https://bbs.bccn.net/viewthread.php?tid=304425&highlight=xml
参考一下这个例子。也许会给你一些思路!
#4
kevinxu06382010-11-24 09:24
回复 3楼 gupiao175
谢谢你的分享 你那个我看了一下 大致的意思明白点 就是将表单里的数据写入到xml中  我现在想要的是将数据库的内容写入到xml中
在研究看看怎么办吧  如果你知道怎么做还望指教
#5
gupiao1752010-11-24 14:08
  操作方法完全一样。无非只是数据来源不同,一个是来自表单,一个是来自数据库,比如:

表单是username=request("表单名")这样取数据。然后放到savexml.asp代码里有段这样的代码:组合成XML数据格式,注意看红色数据部分!
 XMLnode=brstr&"<list>"&brstr & _
  "<id>"&id&"</id>"&brstr & _
  "<username>"&username&"</username>"&brstr & _
  "<fromwhere>"&fromwhere&"</fromwhere>"&brstr & _
  "<Posttime>"&Posttime&"</Posttime>"&brstr & _
  "<text>"&text&"</text>"&brstr & _
  "</list>"&chr(13)

同理数据库的道理也是一样的组合方式!读数据库里的数据应该楼主会吧!无非里面改改形式而已!
  "<id>"&rs("id")&"</id>"&brstr & _
  "<username>"&rs("username")&"</username>"&brstr & _
  "<fromwhere>"&rs("fromwhere")&"</fromwhere>"&brstr & _
  "<Posttime>"&rs("Posttime")&"</Posttime>"&brstr & _
  "<text>"&rs("text")&"</text>"&brstr & _
  "</list>"&chr(13)
#6
kevinxu06382010-11-24 14:21
回复 5楼 gupiao175
回头试试 现在这个地方被我换了一个效果 没用带xml的 呵呵
等忙完了研究下也好学习一下xml
1