January 23, 2019 at 6:32 am #8385
I’m currently on Troubleshooting Import lesson, and struggling on using the xmllint to check errors on XML files. I understand that it is a Unix/Linux command, but I’m currently using Windows 7.
After searching on the web, I figured out that xmllint needs to be installed separately, so I did install it to my computer. Though I have to use a little bit different command to run it.
And then, when I try to answer the quiz, I got this result: https://photos.app.goo.gl/BL5tG85w1vXD4c8r5
None of those errors match with the quiz options, which means I might not applying the correct command or there is something missing on my steps.
Does anyone have any input on this?
Any help would be appreciated.
Thank you in advance,
January 23, 2019 at 8:24 am #8387
- This topic was modified 4 years, 8 months ago by Nazrina.
@bonekarusia The good news is, you’re on the right track! 🙌🏾
The error thrown by xmllint does not say exactly why the document is currently broken. Instead, it gives you a hint regarding where to start looking for the actual issue.
As a next step here, we recommend opening the .XML file in a text editor like https://www.sublimetext.com/ and checking to see if you can find the missing tag manually!January 23, 2019 at 1:13 pm #8394
Thanks, Mahangu! I’ve successfully found the missing tag.
My next challenge was to find the equivalent of
grepcommand for Windows, but I figured it out.
Completed the quiz and proceeding to the next lesson. 🙂January 23, 2019 at 7:40 pm #8396
Excellent! 🙌🏾 We’ve updated the lesson with instructions for Windows users on how to install xmllint / grep, so thank you for that feedback as well.January 24, 2019 at 5:05 am #8400
I am struggling completing the quiz for Troubleshooting Imports. I’m also using Windows 7 and I also able to figure out that I have to install xmllint separately. However, to be honest, I don’t know what special command I need to use to make it work. Fortunately, I was able to get the missing tag manually using the Sublime Text 2.
Now, the challenge I’m having is the grep command. I followed the instructions on this link and I was able to successfully install it. However, when I try to open it, it would automatically close out. Since I cannot use it, I searched on google for the equivalent commands for windows, but I can’t find the specific command format to get the answers to the questions.
I would really appreciate any help from this. A newbie for Unix/Linux command. 🙂
Thank you!January 24, 2019 at 5:49 am #8401
When I typed
xmllint example.xmlit didn’t work for me. I’m using Powershell v1.0.
What did work:
Or you can also use
.\xmllint --valid --noout example.xml
Change example.xml to the file name given in the quiz.
And about the equivalent of grep command, I use findstr. So I didn’t install grep, I only use CMD prompt.
This one worked for me:
findstr -N "example string" example.xml | find /c ":"
Change “example string” to “post_type>post” or whatever string you look for.
The second code was only working on the CMD prompt, not on Powershell. Not sure why.
I hope that will work for you too.
RinaJanuary 24, 2019 at 10:04 am #8402January 24, 2019 at 10:51 am #8403
Happy to share ☺️
Oh, and I was mistaken about the Powershell version. Mine is actually version 2.0.January 24, 2019 at 6:37 pm #8408
Thank you for your suggestions! I was actually using findstr but not really sure how to properly use it in cmd. I got a different answer for the navigation menu count thou. But that’s fine. At least I learned something today! I’m also using Powershell and did exactly what you mentioned but I’m still getting “\xmllint is not recognized as the name of a cmdlet” error. It says Powershell v1.0 but I searched on Google that if you have Windows 7 it is also considered version 2.0. So, I’m not sure why it’s not working. But that’s fine, I found the correct missing tag manually but I missed to choose the correct answer on the quiz. (I overlooked it, my bad!) I’m happy to complete the lesson and got a passing score!
I’m happy to learn something new today! I really appreciate your help!
I’m excited for the next lesson! 🙂January 24, 2019 at 7:41 pm #8409
Awesome! Glad to hear ☺️
Did you type dot (.) before \xmllint? Like
.\xmllintJanuary 24, 2019 at 7:54 pm #8410
Yes I did. Here’s a screenshot. I’m not sure why it’s not working or what I did incorrectly.January 25, 2019 at 6:37 am #8412
Hey Cams, did you run it on the correct path?
I saved all the xmllint files in a folder, and when I run the Powershell, I open this specific folder first: C:\Users\User\xmlan\XML
I know that this is not a problem anymore for you since you found the error anyway, but if you’re curious to find out what you might miss, I’ve documented the installation process in this blog post. It’s password protected, the password is: XMLlint
If it still doesn’t work, don’t sweat it. Perhaps it is a bug on Powershell. It is expected since we use the very old version, lol.
Or perhaps I have some apps/programs in my system that is missing in yours.
January 25, 2019 at 5:54 pm #8423
- This reply was modified 4 years, 8 months ago by Nazrina.
I also have thought that I used an incorrect path. So I saved the xml file to another folder and run it again. However, I’m still getting the same error. I also thought that maybe it’s because I’m using an old version! 😀
I’m also curious why it’s not working for me. I will check your blog post. And when all else fail, I will just believe that it’s because I’m using an old version! lol 😀
Thanks for all your help! 🙂January 25, 2019 at 10:12 pm #8424
Anytime. I hope you’ll get this sorted out in one way or another.
Wish us luck on the next lesson! 😃January 26, 2019 at 7:25 am #8427PoojaDeshpandeMember
@camsmariah It looks like the path for xmllint executable is different than what you are using (I am assuming that from the error). Did you install it at c:\Windows\System32\WindowsPowerShell\v1.0 ? If not try changing current directory to where xmllint is installed. Mine was C:\XML\ and executable was under bin directory so my current directory had to be C:\XML\bin and then I ran the command.
Also, are you running windows 32 bit or 64 bit?
- You must be logged in to reply to this topic.