Search Results

Search found 58802 results on 2353 pages for 'system xml'.

Page 73/2353 | < Previous Page | 69 70 71 72 73 74 75 76 77 78 79 80  | Next Page >

  • java: how to parse html-like xml

    - by Yang
    I have an html-like xml, basically it is html. I need to get the elements in each . Each element looks like this: <line tid="744476117"> <attr>1414</attr> <attr>31</attr><attr class="thread_title">title1</attr><attr>author1</attr><attr>date1</attr></line> My code is as below, it does recognize that there are 50 in the file, but it gives me NULLPointException when parsing NodeList fstNmElmntLst = fstElmnt.getElementsByTagName("attr"); Any idea why this is happening? The same code has been used for other applications without problems. DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); InputSource is = new InputSource(); is.setCharacterStream(new StringReader(cleanxml)); Document doc = db.parse(is); doc.getDocumentElement().normalize(); System.out.println("Root element " + doc.getDocumentElement().getNodeName()); NodeList nodeLst = doc.getElementsByTagName("line"); for (int s = 0; s < nodeLst.getLength(); s++) { System.out.println(nodeLst.getLength()); Node fstNode = nodeLst.item(s); if (fstNode.getNodeType() == Node.ELEMENT_NODE) { Element fstElmnt = (Element) fstNode; NodeList fstNmElmntLst = fstElmnt.getElementsByTagName("attr"); Element fstNmElmnt = (Element) fstNmElmntLst.item(0); NodeList fstNm = fstNmElmnt.getChildNodes(); System.out.println("attr : " + ((Node) fstNm.item(0)).getNodeValue()); } }

    Read the article

  • upgrading from MVC4 to MVC5 pre-Release

    - by Jack M
    I have made that dreadful error of upgrading from MVC4 to MVC5 pre-release by updating the razor, and mvc webpage in my references I have System.Web.Mvc, System.Web.Webpages, System.Web.Webpages.Razor and System.Web.Razor as version v4.0.30319, when I run my application I get [A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to [B]System.Web.WebPages.Razor.Configuration.HostSection. Type A originates from 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll'. Type B originates from 'System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\membership\c70f06fe\9163b1ca\assembly\dl3\291c956e\73c25daa_cf74ce01\System.Web.WebPages.Razor.dll'. is this the same as http://www.asp.net/whitepapers/mvc4-release-notes Thanks Adding a stacktrace: [InvalidCastException: [A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to [B]System.Web.WebPages.Razor.Configuration.HostSection. Type A originates from 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll'. Type B originates from 'System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\c70f06fe\9163b1ca\assembly\dl3\291c956e\73c25daa_cf74ce01\System.Web.WebPages.Razor.dll'.] System.Web.WebPages.Razor.WebRazorHostFactory.CreateHostFromConfig(String virtualPath, String physicalPath) +193 System.Web.WebPages.Razor.RazorBuildProvider.GetHostFromConfig() +51 System.Web.WebPages.Razor.RazorBuildProvider.CreateHost() +24 System.Web.WebPages.Razor.RazorBuildProvider.get_Host() +34 System.Web.WebPages.Razor.RazorBuildProvider.EnsureGeneratedCode() +85 System.Web.WebPages.Razor.RazorBuildProvider.get_CodeCompilerType() +34 System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider) +189 System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders() +265 System.Web.Compilation.BuildProvidersCompiler.PerformBuild() +21 System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +580 System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +571 System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +203 System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) +249 System.Web.Compilation.BuildManager.GetCompiledType(VirtualPath virtualPath) +17 System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +90 System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +380 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +109 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +890 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +97 System.Web.Mvc.Async.<>c__DisplayClass1e.<BeginInvokeAction>b__1b(IAsyncResult asyncResult) +241 System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +29 System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +111 System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +53 System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +19 System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__4(IAsyncResult asyncResult, ProcessRequestState innerState) +51 System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +111 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +606 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288

    Read the article

  • Apply Xslt on in-memory Xml and returning in-memory Xml

    - by Jan Willem B
    I am looking for a static function in the .NET framework which takes an XML snippet and an Xslt file, applies the transformation in memory, and returns the transformed XML. I would like to do this: string rawXml = invoiceTemplateDoc.MainDocumentPart.Document.InnerXml; rawXml = DoXsltTransformation(rawXml, @"c:\prepare-invoice.xslt")); // ... do more manipulations on the rawXml Alternatively, instead of taking and returning strings, it could be taking and returning XmlNodes. Is there such a function?

    Read the article

  • Java HTML parser/validator

    - by at
    We allow people to enter HTML code on our wiki-like site. But only a limited subset of HTML to not affect our styling and not allow malicious javascript code. Is there a good Java library on the server side to ensure that the code entered is valid? We tried creating an XML Schema document to validate against. The only issue there is the libraries we used to validate gave back cryptic error messages. What I want is for the validation library to actually fix the issue (if there was a style="" attribute added to an element, remove it). If fixing it is not easy, at least allow me to report a message to the user with the location of the error (an error code that I can present a nice message from is fine, probably even preferable).

    Read the article

  • xforms "instance namespace" issue

    - by user302254
    I am creating an Xform that reads an XML document and creates an input form for updating the document. However, apparently due to a namespace issue none of my Xpath expressions resolve.My form works fine on a simple instance when the instance file has no namespace. However, I need the namespace support. My instance file has a namespace "ai:inventory." I am referencing the instance data Where should I be declaring the prefix "ai" for my namespace so that my XPath expressions can find the appropriate elements? /ai:inventory/products ? I've tried creating the prefix in the html opening tag... that didn't help. thanks,

    Read the article

  • How define several elements with same name, but different type in xsd:choice element?

    - by Nikolay Ponomarenko
    Is it possible in some way, to define an xsd scheme which could validate such xml: <item_list> <item ItemType="SimpleMessage" Caption="Simplest message"/> <item ItemType="ComplexMessage" SomeAttr="value"> <item_data>some text</item_data> </item> </item_list> Problem is that i havn't find any possibility to define smth like: <xsd:element name="Items"> <xsd:complexType> <xsd:choice> <xsd:element name="item" type="SimpleMessType"/> <xsd:element name="item" type="ComplexMessType"/> </xsd:choice> </xsd:complexType> </xsd:element> But i need to check, that SimpleMessage has no child elements or additional attrs :(

    Read the article

  • Using XPath to access comments a flat hierachy

    - by Sebastian
    I have a given XML document (structure can not be changed) and want to get the comments that are written above the nodes. The document looks like this: <!--Some comment here--> <attribute name="Title">Book A</attribute> <attribute name="Author"> <value>Joe Doe</value> <value>John Miller</value> </attribute> <!--Some comment here--> <attribute name="Code">1</attribute> So comments are optional, but if there is one, I want to get the comment above each attribute. Using /*/comment()[n] would give me comment n, but for n=2 I would naturally get the comment of the third attribute, so there is no connection between attributes and comments Any ideas? Thanks

    Read the article

  • Good or common naming conventions for xsd target namespaces

    - by Anne Schuessler
    I'm looking for some ideas for good naming conventions for xsd target namespaces. Basically I just need to make a definite decision on how to name the target namespace of my xsd so I try to get it right the first time. Changing it later would require changes to another system which is not in my control. Do you have any experience from past XML schema creations on what is a good and working solution? I've tried to find information online, but most examples just use very generic target namespaces like "http://exampleSchema" and similar. I'm actually trying to find some real life examples.

    Read the article

  • Remove anchor from URL in C#

    - by kcoppock
    I'm trying to pull in an src value from an XML document, and in one that I'm testing it with, the src is: <content src="content/Orwell - 1984 - 0451524934_split_2.html#calibre_chapter_2"/> That creates a problem when trying to open the file. I'm not sure what that #(stuff) suffix is called, so I had no luck searching for an answer. I'd just like a simple way to remove it if possible. I suppose I could write a function to search for a # and remove anything after, but that would break if the filename contained a # symbol (or can a file even have that symbol?) Thanks!

    Read the article

  • An invalid character was found in text content.'

    - by Praveen Nambiar
    An invalid character was found in text content.'. Could not find prepared statement with handle 0. sp_xml_removedocument: The value supplied for parameter number 1 is invalid. Below is the xml that i am generating. <NewDataSet> <ControlManagementItems><ControlId>74</ControlId><Value>wqeqe</Value></ControlManagementItems> <ControlManagementItems><ControlId>76</ControlId><Value>Yes</Value></ControlManagementItems> <ControlManagementItems><ControlId>78</ControlId><Value>Consumer Core $100 infinite – Nov 2010</Value></ControlManagementItems> <ControlManagementItems><ControlId>108</ControlId><Value>Samsung Galaxy S 16GB</Value></ControlManagementItems> </NewDataSet>

    Read the article

  • Reset KDE System Monitor (KSysGuard)

    - by Deltik
    Something went wrong while I was attempting to restore a backup, and KDE System Guard ceased to display properly. This is the correct display (command running from root: kdesudo ksysguard): This is the incorrect display (command: ksysguard): Here in the incorrect display, the menu bar is missing, and the tab "Process Table" is unclickable. I have already tried to remove the directory ~/.kde/share/apps/ksysguard/ but to no avail. My question: How do I restore KSysGuard back to factory defaults/normal functionality?

    Read the article

  • Base system driver error - HP Pavilion Entertainment PC dv9323cl

    - by Damurph
    I upgraded to Wndows 7 and have a problem with graphics with my NVIDIA GeoForce Go 7600 not displaying properly. Also the Base System Drivers have yellow flags near them and it states that the The drivers for this device are not installed. (Code 28) There is no driver selected for the device information set or element. To find a driver for this device, click Update Driver. Any clues??? Please help!

    Read the article

  • How to reset KDE System Monitor (KSysGuard)

    - by Deltik
    Something went wrong while I was attempting to restore a backup, and KDE System Guard ceased to display properly. This is the correct display (command running from root: kdesudo ksysguard): This is the incorrect display (command: ksysguard): Here in the incorrect display, the menu bar is missing, and the tab "Process Table" is unclickable. I have already tried to remove the directory ~/.kde/share/apps/ksysguard/ but to no avail. My question: How do I restore KSysGuard back to factory defaults/normal functionality?

    Read the article

  • Windows 7 System Tray Date Display Not Appearing

    - by Anton
    I'm using Windows 7 RC and for some reason, the date won't show at all on my system tray. It used to for a while, but one day it just stopped (I didn't even notice it until someone pointed it out). So I've been trying to fix it, by customizing the format of the date, resetting to defaults, etc... But nothing works, it still doesn't show. The time appears fine.

    Read the article

  • Ubuntu Desktop system restore ?

    - by neolix
    Hello Geeks, We are using all the desktop ubuntu 8.04 to 10.04, we are looking same thing like system resorting to back date like windows feature. Around 500 desktop and 79 server we want to setup. Thanks

    Read the article

  • system center operations manager (SCOM) role combinations

    - by KAPes
    We are evaluating system center operations manager 2007 R2 product, and would like to know what all roles can be combined onto single server. Like root management server and reporting servers can be on one box or not? my environment is like 450 servers mostly Exchange and Domain Controllers plus few OCS servers.

    Read the article

  • system center operation manager role combinations

    - by KAPes
    We are evaluating system center operations manager 2007 R2 product, and would like to know what all roles can be combined onto single server. Like root management server and reporting servers can be on one box or not? my environment is like 450 servers mostly Exchange and Domain Controllers plus few OCS servers.

    Read the article

  • AS3 XML Slideshow Woes

    - by Chris
    Hello All, I am hoping someone out there can possibly shed some light on a couple issues I am having with an image slideshow I have been working on a simple slideshow for a project and everything was going great/as expected up until I created a function to hide the previous images before displaying the next. On the first pass through everything seems to run fine; once the slideshow starts over, the images don't show up, yet when it goes to load the following image, it plays the tween from the hide previous function which shows the image briefly before fading out. So essentially the display is blank, then the timer calls in the next slide and its a brief flash of an image fading out, and then blank again. Another issue I am having is the text that I am loading in from the XML does not seem to want to tween in or out as they are supposed to. Here is the code: import fl.transitions.Tween; import fl.transitions.easing.*; import fl.transitions.TweenEvent; import flash.display.BitmapData; import flash.display.Bitmap; import flash.display.Sprite; import flash.utils.Timer; import flash.events.TimerEvent; var filePath:String = "photo1.xml"; var iArray:Array = new Array(); var titleArray:Array = new Array(); var dateArray:Array = new Array(); var catArray:Array = new Array(); var descArray:Array = new Array(); var rotationSpeed:Number; var totalImages:Number; var dataList:XMLList; var imagesLoaded:Number = 0; var currImage:Number = 0; var rotationTimer:Timer; var oldTween:Tween; var imageContainer:Sprite = new Sprite(); var imageHolder:Sprite = new Sprite(); var titleContainer:Sprite = new Sprite(); var dateContainer:Sprite = new Sprite(); var catContainer:Sprite = new Sprite(); var descContainer:Sprite = new Sprite(); var theMask:Sprite = new Sprite(); theMask.graphics.beginFill(0x000000); theMask.graphics.drawRect(114, 25, 323, 332); addChild(theMask); var loader:URLLoader = new URLLoader(); loader.addEventListener(Event.COMPLETE, onComplete); loader.load(new URLRequest(filePath)); function onComplete (evt:Event):void{ var pigData:XML = new XML(evt.target.data); pigData.ignoreWhitespace; dataList = pigData.pic; totalImages = dataList.length(); rotationSpeed = pigData.@speed * 1000; stage.scaleMode = StageScaleMode.NO_SCALE; loadImages(); rotationTimer = new Timer(rotationSpeed); rotationTimer.addEventListener(TimerEvent.TIMER, rotateImage); rotationTimer.start(); } function loadImages() { for (var i:Number = 0; i < totalImages; i++) { var imageURL:String = dataList[i].big; var imageLoader:Loader = new Loader(); imageLoader.load(new URLRequest(imageURL)); imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded); iArray.push(imageLoader); var titleField:TextField = new TextField(); var dateField:TextField = new TextField(); var catField:TextField = new TextField(); var descField:TextField = new TextField(); titleField.text = dataList[i].title; titleField.autoSize = TextFieldAutoSize.LEFT; titleArray.push(titleField); dateField.text = dataList[i].date; dateField.autoSize = TextFieldAutoSize.LEFT; dateArray.push(dateField); catField.text = dataList[i].category; catField.autoSize = TextFieldAutoSize.LEFT; catArray.push(catField); descField.text = dataList[i].description; descField.autoSize = TextFieldAutoSize.LEFT; descArray.push(descField); } } function imageLoaded(evt:Event):void { imagesLoaded++; if (imagesLoaded == totalImages) { showImage(); } } function showImage():void { addChild(imageContainer); imageContainer.addChild(imageHolder); imageContainer.addChild(titleContainer); imageContainer.addChild(dateContainer); imageContainer.addChild(catContainer); imageContainer.addChild(descContainer); changeImage(); } function changeImage():void { var currentImage:Loader = Loader(iArray[currImage]); imageHolder.addChild(currentImage); currentImage.x = (stage.stageWidth - currentImage.width)/2; currentImage.y = (imageHolder.height - currentImage.height)/2; imageHolder.mask = theMask; new Tween(imageHolder, "alpha", Regular.easeOut, 0, 1, 1, true); var titleField:TextField = TextField(titleArray[currImage]); titleContainer.addChild(titleField); titleField.x = 107; titleField.y = 365; var titleTween:Tween = new Tween(titleField, "alpha", Regular.easeOut, 0, 1, 1, true); var dateField:TextField = TextField(dateArray[currImage]); dateContainer.addChild(dateField); dateField.x = 107; dateField.y = 375; var dateTween:Tween = new Tween(dateField, "alpha", Regular.easeOut, 0, 1, 1, true); var catField:TextField = TextField(catArray[currImage]); catContainer.addChild(catField); catField.x = 107; catField.y = 385; var catTween:Tween = new Tween(catField, "alpha", Regular.easeOut, 0, 1, 1, true); var descField:TextField = TextField(descArray[currImage]); descContainer.addChild(descField); descField.x = 107; descField.y = 395; var descTween:Tween = new Tween(descField, "alpha", Regular.easeOut, 0, 1, 1, true); } function rotateImage(evt:TimerEvent) { hidePrev(); currImage++; if (currImage == totalImages) { currImage = 0; } changeImage(); } function hidePrev():void{ var oldImage:Loader = Loader(imageHolder.getChildAt(0)); oldTween = new Tween(oldImage,"alpha", Regular.easeOut, 1, 0, 1, true); oldTween.addEventListener(TweenEvent.MOTION_FINISH, onFadeOut) var oldTitle:TextField = TextField(titleContainer.getChildAt(0)); var oldTitleTween:Tween = new Tween(oldTitle,"alpha", Regular.easeOut, 1, 0, 1, true); var oldDate:TextField = TextField(dateContainer.getChildAt(0)); var oldDateTween:Tween = new Tween(oldDate,"alpha",Regular.easeOut,1,0,1,true); var oldCat:TextField = TextField(catContainer.getChildAt(0)); var oldCatTween:Tween = new Tween(oldCat,"alpha",Regular.easeOut,1,0,1,true); var oldDesc:TextField = TextField(descContainer.getChildAt(0)); var oldDescTween:Tween = new Tween(oldDesc,"alpha",Regular.easeOut,1,0,1,true); } function onFadeOut(evt:TweenEvent):void{ imageHolder.removeChildAt(0); titleContainer.removeChildAt(0); dateContainer.removeChildAt(0); catContainer.removeChildAt(0); descContainer.removeChildAt(0); } I'm no flash whiz, bet can generally figure most issues out by either analyzing the code, or digging around online; however, this has me stumped. Any help would really be appreciated, and I thank you all in advance.

    Read the article

< Previous Page | 69 70 71 72 73 74 75 76 77 78 79 80  | Next Page >